cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
wanjos
Frequent Visitor

Loop within a loop problem

Hi,

 

I need to send reminders to people attending activities on the day. It could be 4 different activities and various people attending one or many. I get items from a sharepoint list for the activities - all the info I need for however many activities there are that day. This is done in a loop.

 

I then want to send an email for each of these activities, but I need to get the attendee emails first. I use another get items and add the emails to an array, which creates a second loop.

 

My issue is to access the email array, I need to be in the second loop, but this means I get repeat emails as the email array is built. But if I send email after this loop, I don't have visibility of the array emails.

 

What am I doing wrong?

 

Cheers

 

Will

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @wanjos ,

 

Sorry, I misread your question.

 

If you want to email the array, I dont think it is possible as the body will expect string/HTML

 

You can change your variable from array to string and and use Append To String.

 

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

Connect on LinkedIn

View solution in original post

4 REPLIES 4
eric-cheng
Solution Sage
Solution Sage

Hi @wanjos ,

 

Can you share a screenshot of your flow?

 

You can initiate an array variable and append to it in the loop from your email array.  You can then reference it anywhere in the flow.

 

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

Connect on LinkedIn

 

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

Connect on LinkedIn

Hi Eric,

 

That's my experience of using variables in other flows, but not this time. Here's the screenshot.

 

Screenshot 2021-09-25 165401.png

 

Thanks for taking the time. 

Hi @wanjos ,

 

Sorry, I misread your question.

 

If you want to email the array, I dont think it is possible as the body will expect string/HTML

 

You can change your variable from array to string and and use Append To String.

 

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

Connect on LinkedIn

View solution in original post

Thanks @eric-cheng, worked perfectly!

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Users online (2,026)