cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Delete items from Sharepoint list

roland-daane
Deputy Chef II
Deputy Chef II

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)

6 REPLIES 6

roland-daane
Deputy Chef II
Deputy Chef II

I got the 2 headers in, but still getting the same error.....


sophat-sam
Deputy Chef I
Deputy Chef I

hi Roland Daane ! here's an example call that worked for me with the headers called out:


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....



sophat-sam
Deputy Chef I
Deputy Chef I

here's the

step itself with the data outputs from the loop: