All of my workflows for a site have the ability to log data in the Workflow History list on my site. This is controlled at run-time with a parameter in list based on the workflow Name. I would like to be able to run a workflow on this setup table that will delete all records in the History list. My understanding is I can do this via REST call in SharePoint Designer workflow.
I have attempted many times to configure the REST Post command in Designer and I am never able to get this to work. I've searched over and over for a solution and not able to find such a solution.
I first tried deleting all that had the Workflow Association ID equal to the Workflow Name, but could not get that to work. Then I thought I would try selection each value using REST and then deleting that value using REST by the ID I received from the GET.
This is my delete (POST).
[%Workflow Context:Current Site URL%]/_api/lists/GetByTitle('Workflow History')/GetItemObject('[%Variable: HistoryID%]')
I also tried the DeleteListItem
[%Workflow Context:Current Site URL%]/_api/lists/GetByTitle('Workflow History')/DeleteListItem('[%Variable: HistoryID%]')
I want the user to be able to run this on any workflow from the setupWorkflow list I have. The workflow should delete all history for the current workflow.