SharePoint / SharePoint Online – Calling REST Service from SharePoint Designer Workflow
Hello All,
Today, we are going to discuss how REST service is called in from SharePoint Designer Workflow. For demonstration purpose I am accessing my Login Name through REST API from Site Users Information List.
Let’s get started!!
Prerequisites:
- Should have SharePoint Designer installed.
- Should know how to create list workflow.
Follow these steps:
- Create List Workflow.
- In the Stage 1 (You can rename Stage 1 to any meaningful name you want), add an action Build Dictionary or just click on orange bar and type build and press ENTER. It will add Build Dictionary See following figure.

Figure .1 Adding action
- Click on “this” in the action to open Build A Dictionary and click Add.

Figure .2 Adding request headers
- We are going to add two request headers
- Name: Accept
Type: String
Value: application/json;odata=verbose
- Name: content-type
Value: application/json;odata=verbose
Request headers are required to send request to web server containing details of what the browser wants and will be ready to accept back from server. Do not make any mistake while writing value for above two request headers. A single mistake and you will not get output. Click Ok.
- Create output variable. Name it whatever you want. In this case RequestHeader.
- Now add action Call … Http web service
- Click on “this”. It opens Call HTTP Web Service window as follows. Click on three dots next to the text field provided below Enter the HTTP web service URL.

Figure .3 Calling web service
- It opens String builder dialog. Click on Add or change lookup. Next dialog will be opened is Lookup for String. Select Data Source as Workflow Context and Field from source as Current site URL and finally click Ok.
For reference please have a look to following figure.

Figure .4 Creating lookup string
- Complete url as shown in the following figure. i.e. “SiteUrl/_api/web/siteusers/getbyid(10)” here I am applying filter by using getbyid(10) where 10 is my user id.

Figure .5 Complete URL
- Right click on Call action and open Select proper variable name against their Parameters. Refer following figure. And click Ok.

Figure .6 Setting web service properties
- If you want to check response code value, log response code variable using Log to History List action
- Add Get Click Item by name or path and then click three dots next to it. In the string builder type d/LoginName. Select response content, which is collection of data requested by you. Select or create output variable.

Figure .7 Getting Results
- Log output variable. Follow the same procedure as we did in step 8 or simply click “fx” symbol. Just this time select Workflow Variables and Parameters as Data Source and select your variable you created as output variable, in this case Output. Click Ok.
- In transition to stage select End of Workflow.
- Save and Publish.
- Here I am starting workflow manually. You can choose any option among three options available.
- Check the output below.

Figure .8 Output of Workflow
- Highlighted by yellow marker is our output (Login name).
This is how REST service is called from SharePoint Designer Workflow.
References:
http://www.c-sharpcorner.com/article/calling-rest-api-from-a-sharepoint-designer-workflow/
Thanks for reading 🙂
Keep reading, share your thoughts, experiences. Feel free to contact us to discuss more. If you have any suggestion / feedback / doubt, you are most welcome.
Stay tuned on Knowledge-Junction, will come up with more such articles
You must log in to post a comment.