0

I'm trying to create a reusable workflow that will send notifications to users about updated items in lists/libraries associated with a master tracking list.

I've got something like this:

  • TRACKING LIST --> has Lookup column and Assigned To column (OOTB site column, set to allow multiple people)

  • List 1 --> lookup column links to multiple items in TRACKING LIST

  • List 2 --> lookup column links to multiple items in TRACKING LIST
  • Library A --> lookup column links to multiple items in TRACKING LIST
  • Library B --> lookup column links to multiple items in TRACKING LIST
  • Library C --> lookup column links to multiple items in TRACKING LIST

So when something is updated in one of these lists, I want notifications to go out to people "Assigned" to that item in the tracking list (for example, if something is added to List 1 and tagged with item 1 from the TRACKING LIST, the people in "Assigned To" get a notification).

For this to work for a reusable workflow, I know I'll need to make an HTTP web service call. I've figured and tested out how the links will look:

For lookup ID's:

[%Workflow Context:Current Site URL%]/_api/web/lists/GetByTitle('[%Workflow Context:List Name%]')/items('[%Current Item: ID%]')?$select=MyLookup/ID&$expand=MyLookup

This seems to work too:

[%Workflow Context:Current Site URL%]/_api/web/lists/GetByTitle('[%Workflow Context:List Name%]')/items('[%Current Item: ID%]')/MyLookup

Then once I have the ID's I use:

[%Workflow Context:Current Site URL%]/_api/web/lists/GetByTitle('TRACKING LIST')/items('[%--workflow variable for the ID--%]')?$select=AssignedTo/EMail&$expand=AssignedTo

I've tried manually in my browser and get the info I want. Unfortunately in my workflow I'm at a loss once I make a successful call (response code 'OK') I can't figure out how to get anything useful out of the Dictionary. I likely just need help with the syntax. I can't find any examples that get me any data out.

Alternatively, would there be any way for me to get the email addresses all at once? Something like this (but this specifically doesn't work):

...../items('#')?$select=Lookup/AssignedTo/EMail&$expand=Lookup

Again, once I've got that, what's the syntax to get the items out of the dictionary?

  • Hi, So your are asking for the process of rest call from a workflow? – Md. Tahmidul Abedin Mar 16 '18 at 4:24
  • That's right; After I make the call for the lookup ID's, I need to loop through to get the ID's, and for each ID I need to make another call to the tracking list for the emails of everyone in "Assigned To" for that item (to send an email to them). My problem is I can't get the syntax right for getting the item from the response content dictionary, and I can't get the count to work to loop through. – Matt Mar 16 '18 at 14:54
3

As you saying that these rest calls providing expected results, I think probably there is some problems with the deceleration. As it is hard to provide all the details about triggering the rest call's from Workflow. I am providing an article link here, hopping it will help you.

So, check this article, it has details on using rest call from workflow and looping here.

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.