SpRestLib icon indicating copy to clipboard operation
SpRestLib copied to clipboard

Error when updating item using JSON.stringify

Open beruken opened this issue 4 years ago • 0 comments

Everything seems to work well with the exception of updating an item. After inspecting the network call it consistently shows "lists/getbytitle('Title of List')/items(undefined)" despite passing what appears to be a valid json object with the Id: int of the item. However, after further inspection (Thanks to your Sandbox in the demo app!!) I found SPRestlib or maybe even SP doesn't like the Key being wrapped in quotes such as {"Id:":1234,"Title":"It Doesn't work"}. However {Id:1234,Title:"It worked"} works fine. Obviously this is a JSON.stringify issue when converting my objects. I can't seem to find any way to force stringify not to quote the key. Any idea how to deal with this? K

beruken avatar Feb 28 '20 14:02 beruken