Hi Michael, I can't find a way to update the field of UserStatus so I went for another way which is to display alternative status name when another field in workflow called Status is Terminated. The field of Status can be updated when the workflow instance is terminated or stopped.
How to update the field of Internal Status or UserStatus of SharePoint 2013 workflow instance?
Hi all, I'm using SP workflow 2013 for my provider hosted solution in SharePoint online. The workflow I used is 2013 version and I use CSOM to interact with the workflow. I want to create a button which will terminate the workflow when it is clicked which I managed to do so but I can't update the field of Internal Status or .UserStatus where you can see it from API of WorkflowInstance.
I tried with the sample code below but seems it doesn't working for my case. Anything I missed out?
targetInstance.UserStatus = "Cancelled by Requestor";
appClientContext.ExecuteQuery();
1 additional answer
Sort by: Most helpful
-
MichaelHan-MSFT 18,036 Reputation points
2021-07-02T07:55:13.05+00:00 Hi @teik boon teh ,
Per my test, I got the same result as yours on my end.
Looks like the UserStatus property of WorkflowInstance can not be changed with CSOM.
If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.