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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

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.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (1,806)