Sharepoint 2013 REST API issue - Value does not fall within the expected range
Question
I am trying to update a Tasks
list item via REST and sending the following body to SharePoint API via POSTMAN tool:
{
"__metadata": {
"type": "SP.Data.TasksListItem"
},
"Status": "Approved",
"WorkflowOutcome": "Completed",
"PercentComplete": 1
}
But I only receive the following error, I tried multiple combinations. I tried even updating only Title
, but always the same error response. Any clue what is the issue here?
Solution
I do not believe that "Completed" is a valid value for "WorkflowOutcome", you have to set it to "Approved". It has been a couple of years since I wrote this, but I performed a similar REST call on an old project that programmatically completes a workflow task using the following:
{
"__metadata": {
"type": "SP.Data.TasksListItem"
},
"Status": "Approved",
"FormData": "Completed",
"WorkflowOutcome": "Approved",
"Completed": true,
"PercentComplete": 1
}
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange