I have a SharePoint list that looks like the following (as an example):
|B||SuperOne@anything.com (notice this is the same person as is in Dept A)|
In my form the person selects the department who's supervisors need to be notified (so for Dept A all 3 supervisors need to be sent an email).
I have read multiple articles on this and realize that I probably need a collection variable, a for each, etc, and even though this seems like it would be really easy... I just can't figure it out.
I could really use some detailed instructions on how to do this and don't be afraid to dumb it down! : )
Solved! Go to Solution.
So, after I actually read through the tutorial, I realized it doesn't exactly answer your scenario. You can use the query list to query your list and filter for when department equals whatever the user selects in your form, and then return the Supervisor Email. Store that in a collection variable. Then use the For Each to run through each of those and send them a notification.
Ok, very helpful! Just a little more handholding needed. I'm good until the last sentence. On the For Each action, do I need an Index here and do I need to put in a collection operation inside of the For Each loop? If I do need the Collection Operation... I need help on this part, config settings.
When you configure the "For Each", you'll pick your target collection. So you'll pick the collection variable you created and used in the query list. Then for the 'Store Results In' option, you'll need to create a new variable. You can use the single line of text. This is where the For Each will store the individual supervisor email when it's going through the collection. You won't need an index. Then within the For Each you can configure a Send Notification. In the 'To' field of the notification you would put the single line of text variable that's holding the supervisor email.
So the For Each goes through the collection and pulls out the first email address in the collection and stores that in the single line of text variable. Then it perfoms whatever actions within the For Each. Once it completes those actions, it goes back into the collection and gets the second item. It does this until it it goes through every item in the collection.
Oh, I didn't see the screen shot initially. You won't need the collection operation in the For Each. Just put your send Notification. You can perform the actions on the collection in the configuration of the For Each action.
I just ran a quick test, and actually you don't even need the For Each. You can drop the collection variable directly into the 'To' section on the Notification and it will work. So that saves you a step.