3

Good Morning All, does anyone have any good articles, notes and\or documentation on how to configure and develop a rest web service call within a SharePoint Designer 2013 workflow? I've found plenty of articles for the on-premises, but not much (that's actually good) for O365. So far I've found the following articles and they do not work for me:

Also, with regards to performance within a SharePoint Designer Workflow...Which is better:

  • Adding and Update operations using the Current Item, Update Item workflow actions or....
  • Using the REST service operations calls (PUT, POST,etc...)
  • What exactly are you trying to do, this is rather vague. I would prefer to use the native capabilities over REST. It is much more error prone in setup to create or edit items through web services in a Designer workflow than using the standard built in actions. – Eric Alexander Aug 12 '15 at 13:32
  • I had same question with now answer... sharepoint.stackexchange.com/questions/144796/… – Atish Dipongkor - MVP Aug 12 '15 at 13:35
2

I've been using the REST api in designer workflows quite a lot for the last few years, it enables a lot of interesting usecases, but it is quite poorly documented.

You don't mention what you're trying to do, so I'll just start out with a simple one: Fetching items from a list.

First off workflows can't handle anything but JSON, so start by creating a dictionary with the following two entries:

Name = Accept Type = String Value = application/json;odata=verbose

and

Name = Content-Type Type = String Value = application/json;odata=verbose

To get items from a list use this endpoint:

_api/web/lists(guid'[Enter guid of the list here]'/items

There is also an endpoint to grab it by title of the list, but it's prone to error if the user decides to change the name so I only uses the guid.

Add a http call, enter the site url + the endpoint. Keep http method = GET. Now here's the tricky part one could easily forget. Right click the http action line and choose properties. Here you need to set the request headers to the variable you created in the very beginning.

And your done - but wait you wanted to do something with the items right? Ok then you have to create a dictionary for the response to be placed (Simply click the link next to response content). Now you have all items in the list and can do your magic from here.

The easiest way I know of to get the actual items is to get the inner array of items by key - in this case the key is d/results

Now you can loop the array and go from there. Getting the ID from the items by key would look like this: (0)/IDfor the first position in the array.

On the subject of using rest or build in, I would strongly recommend using the build in whenever possible, it's less prone to errors from users. Also keep in mind a failed rest call will NOT suspend the workflow - in orther words ALL error handling you need to take care of yourself. This can be a good and a bad thing depending on your situation.

Feel free to reach out if anything is unclear or if you have a specific question regarding the REST api.

0

I think I know what you mean, but there may not be that much general information out there (there was not when I was looking) I started with this handy blog and went from there, maybe it will help you get a better understanding -

Create subsite with call HTTPS web service

0

SharePoint Designer 2013 introduces four new actions that you’ll use when accessing data via web services.

  • Call HTTP Web Service
  • List item
  • Build Dictionary
  • Count Items in Dictionary
  • Get Item from Dictionary

For detailed steps on REST API call you can refer this post : https://blog.appliedis.com/2014/10/09/sharepoint-designer-2013-workflow-working-with-web-services/

Also to answer your next question on performance, "Adding and Update operations using the Current Item, Update Item workflow actions or".... will be better than REST API call.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.