cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
guyinazo
Level 8

Iterate through a gallery or collection of emails for a flow

I have an app that I am building that needs to use a flow to e-mail those selected, however I found out that in the flow I cannot use an "Apply To Each" container as it errors out on the OnSelect Button of the form and doing research, this is a known issue for Power Apps.  Does anyone know of a workaround?  Is there like a For Each Item statement I can use in the OnSelect and then in that loop, send the parameters to the Flow.Run() statement?

 

Thanks

 

Brad

 

PS:  I may have found the answer here, but I will post and update if this does work: https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-forall 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Iterate through a gallery or collection of emails for a flow

I think this video will help.

 

PowerApps Collection - Send emails, sum, and format

 

Shane - Microsoft MVP, YouTube, and PowerApps Consulting for when you are in a bind to get this fixed quickly. And finally we now have PowerApps Training

View solution in original post

9 REPLIES 9
Super User
Super User

Re: Iterate through a gallery or collection of emails for a flow

I think this video will help.

 

PowerApps Collection - Send emails, sum, and format

 

Shane - Microsoft MVP, YouTube, and PowerApps Consulting for when you are in a bind to get this fixed quickly. And finally we now have PowerApps Training

View solution in original post

guyinazo
Level 8

Re: Iterate through a gallery or collection of emails for a flow

Shane!!!!  You know I love your videos and thanks for the response.  I probably did watch this, but will watch it again.

 

Brad (aka GuyInKalamazoo)

Super User
Super User

Re: Iterate through a gallery or collection of emails for a flow

Cool. Let me know if you can't get it. Happy to help. 🙂 

Shane - Microsoft MVP, YouTube, and PowerApps Consulting for when you are in a bind to get this fixed quickly. And finally we now have PowerApps Training
guyinazo
Level 8

Re: Iterate through a gallery or collection of emails for a flow

So then from what I understand I could just use the Office365 connector and use SendEmail and then use a Concat to iterate through the collection of emails and specify the subject and body within the function.  The second and third step in my flow then is to add a Task in the user's outlook and also add a task in a shared Planner in the HR team.

Super User
Super User

Re: Iterate through a gallery or collection of emails for a flow

What parameters is your Flow expecting to receive? 

 

Code off the top of my head

 

ForAll(YourCollection, YourFlow.Run(UsernameParameter, TaskParameter)

 

In my head that works but I haven't tried it. 

Shane - Microsoft MVP, YouTube, and PowerApps Consulting for when you are in a bind to get this fixed quickly. And finally we now have PowerApps Training
guyinazo
Level 8

Re: Iterate through a gallery or collection of emails for a flow

Yep, that is what I am testing now and that syntax is what I need.  The flow is accepting params from Power Apps and right now it is just e-mail.  I have Expressions in the Flow to evaluate due date, etc.  My first "test" run by just using me worked as I got an email and a task in my Outlook tasks, but failed on the Planner.  I still need to work through that and my next test will include adding some co-workers to see if it will iterate through each.  I will post to let you know (and accept yours as a solution too)

Super User
Super User

Re: Iterate through a gallery or collection of emails for a flow

Check out this video by Dan Christian for creating a Planner task with Flow

Shane - Microsoft MVP, YouTube, and PowerApps Consulting for when you are in a bind to get this fixed quickly. And finally we now have PowerApps Training
guyinazo
Level 8

Re: Iterate through a gallery or collection of emails for a flow

And I did just test with three people and again, the e-mail and the Task works.  I will check out that Planner vid by Dan.  Thanks for your help and keep up the great work on your videos.  I am a subscriber and watch them

guyinazo
Level 8

Re: Iterate through a gallery or collection of emails for a flow

In my email notification flow I had to concat the URL for our web app tenant and attach the ID of the actual task.  I guess in Planner right now there is no easy way to get a link to that task.  But anyway, it all is working now.  If I get time I might do a quick tutorial on what I just did an post it out to my website and YouTube.

 

Thanks again

Helpful resources

Announcements
thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (6,573)