I am building a Flow that collects items from three different Sharepoint lists and then composes a string of email addresses.
To compose the string of emails, I use an array variable.
My issue is, that if there are more than one Apply to each loop, the variable adds new addresses for every loop, with the end result that people are added to an email list where they shouldn't be.
What is the solution to this?
Edit for clarification:
- I want to create one string of email addresses for each item that the "Get Items Emails To Send" delivers, with only the emails that belong to participants in the event that is connected to the "Get Items Emails To Send" item.
- I will never know how many events that the "Get items Emails To Send" will deliver (in my example 2, resulting in 2 apply t o each loops - but there may be 1 or 576).
- "Get items Event" will always get 1 item per "email to send" item.
- I will never know how many items "Get items Participants" will deliver (in my example there are 2 different participants per event, but there may be 1 or 934)
This is a simplified version of the flow, with one extra compose action for testing.
This is the build.
And this is the FLow when there are two items in the "Get items Emails To Send" list.