Search code examples
restsharepoint-2013sharepoint-designer

My history table is too large to view (over 5k records). Trying to create workflow to delete entries


I have a workflow that queries the history table returns a list of IDs and trying to delete each of those items. My first REST call is

<site URL>/_api/lists/GetByTitle('Workflow%20History')/Items?$select=Id

This returns a valid set of records, then I have a second rest call to delete a record It's a POST REST call with the end point:

<site URL>/_api/web/lists/getbytitle('Workflow History')/GetItemById(1)

I get a bad request as a response to the second REST call. I'd prefer to not select and then delete and just delete based on a filter condition. Any assistance, I would appreciate some help.

Thank you


Solution

  • You could refer to this post to delete list item using rest api in workflow: https://social.technet.microsoft.com/Forums/en-US/ef8057c3-c96a-4d04-b3c4-4c8bcd7ce2d2/sharepoint-designer-2013-call-http-web-service-delete-workflow-not-working?forum=sharepointdevelopment

    the header dictionary should as below:

    enter image description here