Latest Posts

REST-API GET call from SharePoint designer Workflow

In this article we will understand how to get a list item value in the SharePoint designer workflow using REST-API GET method. Designer workflows are a very essential part of most of the SharePoint development projects. Let’s see how we can use REST-API GET method in the designer workflow.

The step-by-step process of getting list item in the designer workflow using REST-API GET method

You can check how to get a list item using REST-API programmatically. The same example we have utilized for the reference in this article.

  1. Open SharePoint Designer. Here, we have shown List workflow. Click on List Workflow from Ribbon and add workflow details. Make sure you select latest platform Type – SharePoint 2013 Workflow
  2. create sharepoint 2013 workflow
  3. In Stage 1, click on Action from Ribbon and then from dropdown select, Build Dictionary.
  4. add action build dictionary
  5. We are going to create a variable of Type Dictionary and save REST call headers in it. As shown in the screenshot below, click on the ellipsis (…) to build dictionary variable values and add headers.

    Name

    Type

    Value

    Accept

    String

    application/json;odata=verbose

    Content-Type

    String

    application/json;odata=verbose

  6. dictionary values
  7. Next, we will add Call HTTP Web Service action.
  8. add action call http web service
  9. Select the web service action and then click on the Advanced Properties from Ribbon Menu.
  10. advanced properties navigation
  11. Now, we will add a few values which are very essential. Here, you are constructing the actual request. Mainly we have added below three parameters.
    • Address: This is the REST API URL value. You can construct it according to your requirements.
    • RequestType: Here we have used HTTP GET method as we are fetching a list item
    • RequestHeaders: This is the headers of the REST call we will assign dictionary value that we created in the first step (HeaderDictionary)
    • RequestContent: we can leave it blank for GET call
    • ResponseContent: This is a variable of the type Dictionary that holds the data returning by the REST call.
    • ResponseStatusCode: This is not mandatory but just kept to check the status of the REST call
    http web service values
  12. We will add one more action. Get an Item from a Dictionary.
  13. add action get an item from a dictionary
  14. Select a path from JSON response which we got in earlier call and store value in a string variable
  15. get an item from a dictionary
  16. The value that we want from the REST call is stored in a variable. You can utilize that variable as per your needs.
  17. I have logged the response just to show the value of the response.
  18. show response value
  19. Complete REST-API GET call from SharePoint designer looks like below.
  20. Complete REST-API GET call
  21. Set Transition to stage add Go to End of Workflow
  22. end of workflow
  23. Now you can publish this workflow.
  24. Go to your list and manually start the flow (you can set the trigger of the flow according to your requirement).

You can check some REST-API examples and create a designer workflow with their reference.

Conclusion:

We gone through the steps to create a designer workflow and how to create REST - GET requests using that.


We value your Feedback:

Page URL:

Name:

 

Email:

 
 

Suggestion:

 

© 2024 Code SharePoint