Skip to main content

I’ve seen an example to do this from a form, but this is in a SharePoint list. I have a repeating section. I can extract each field (name and email address), but can’t figure out how to send an email to each and addressing each one by name. 

For instance, I want to send an email to each sfisher@gmail.com and to bbobber@gmail.com and address each one with their name respectively. (send to sfisher@gmail.com and say “Hi Sam”) I queried each xml field and can get that data. Here are my queries in the workflow:

 

Hi ​@rkohnasb 

If you’ve extracted the data for both the email and the name then you should have 2 collections.  If you use a loop for each action you should see that you can set a variable for the index of the loop.  then you can use the get item from collection in the for each loop to get that index from your second collection.  Then in your email you can use the current item from the loop for each and the variable you stored the value from your second collection in to construct the email.

Alternatively, you could use the merge collections action to generate a collection of objects that you could use in the for each loop.  This is beneficial if you have several properties that you many want to join together.


Hello brent_read, 

Thank you very much for the suggestions! I opted for your second suggestion as I’m kind of lost with your first one. I merged the collections and see the options I can use for the email, but I receive an error that “At least one recipient is not valid”. Here is what the merged object result gives me: 

The first one is from the first XML query of the names and the second is the second XML query. 

Would you be able to tell me how to extract the names and email addresses correctly from the merged object? 

Thank you!


I was able to figure this out with looping through each. Posting here for reference in case it helps someone else out. Thank you for pointing me in the right direction!

 


Reply