TransWikia.com

REST or any other API for client side dev to get current users running workflows(Designer or OOTB or MS Flow)?

SharePoint Asked by Sree Kuttan on October 25, 2021

As part of a requirement the clients would want us to create an SPFX webpart which displays all the document names and the tasks or workflows running on it for that user/current User. Is there a way in Client side with which i can get this detail? This has to be all the workflows running for current user.
Any help is greatly appreciated!!!!

One Answer

I'm not sure about Flow, but you can interact with the Workflow Services from the client side. Here are a couple articles covering how to get that set up:

https://social.technet.microsoft.com/wiki/contents/articles/24786.sharepoint-2013online-workflow-service-in-jsom-part-1.aspx

https://docs.microsoft.com/en-us/sharepoint/dev/general-development/working-with-the-sharepoint-workflow-services-client-side-object-model

Using the Workflow Services JSOM you can interact with the Deployment Service which you use to get the workflow definitions available on a site, the Subscription Service which you use to figure out which workflows are attached to which lists, and the Instance Service, which you would use to find currently running workflows.

Some of the client side functionality is available through REST endpoints like

/_api/SP.WorkflowServices.WorkflowInstanceService.Current/[method name]

This question has a few links that may be helpful in figuring out what REST endpoints are available, but that being said, I see no reason why you couldn't just make sure SP.WorkflowServices.js is loaded so that you can use the regular JSOM from your SPFx webpart.

Answered by Dylan Cristy on October 25, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP