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?