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

Thanks @eric-cheng, worked perfectly!

Helpful resources

Announcements
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

New Process Advisor Capabilities carousel.png

Read the blog for the latest news

Read the latest about new experiences and capabilities in the Power Automate product blog.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

Users online (2,105)