โ11-04-2021 02:55 PM
Hi, I'm trying to delete all items from a SharePoint list, but keep getting this error:
412 Precondition Failed: {"odata.error":{"code":"-1, Microsoft.SharePoint.Client.ClientServiceException","message":{"lang":"en-US","value":"The request ETag value '' does not match the object's ETag value '\"d83ffc2b-6c9f-4db1-b0b1-1c1bfcfd4c16,1\"'."}}}
I found thet the headers needed to include:
X-HTTP-Method: Merge
If-Match: ETag
I first call:
_api/web/lists/getByTitle('B360__Issues')/items
Then in a loop
_api/Web/Lists/getByTitle('B360__Issues')/getItemById(ID from step 2)
โ11-04-2021 04:32 PM
I got the 2 headers in, but still getting the same error.....
โ11-04-2021 04:38 PM
hi Roland Daane ! here's an example call that worked for me with the headers called out:
โ11-04-2021 08:15 PM
Hi Sophat,
It runs now without errors.
For some reason the foreach loop just picksup 1 item whilt the Json output for step 2 contains a couple of hundred items.
It does delete that 1 record.
Oh and by the way: had a great discussion with our NL business and they're opening up to using Workato to connect with autodesk Construction Cloud....
โ11-04-2021 04:39 PM
here's the
step itself with the data outputs from the loop: