cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Super User
Super User

nding multiple emails from a collection

 

 

Hi!

 

I'm making an internal ordering system where my department gets orders from people all around the organisation. They submit their respective orders using another app, saving the data on our in-house SQL server.

 

In the second app I aggregate the separate orders into a single one. For each order row the name and email of each person is stored, along with information about the product. The screen shot shows the aggretated list in the lower half, where one person can have multiple entries.

 

 

 orderscreen.png

 

From this list I have made a grouped collection, since each person needs to receive only one email with all the products he or she ordered. I do this with:

 

ClearCollect(cGroupedOrders; AddColumns(GroupBy(gOrderraderOrderScrn.AllItems; "Bestallare"; "BestEpost"; "Orderrad"); "Ordertotal"; Sum(Orderrad; Summa)))  and it works like a charm.

 

Here's (finally) my problem: How do I send an email to each of the recipients in the cGroupedOrders collection?

 

I tried doing a ForAll(cGroupedOrders;  Office365.Sendmail(...)) but I get the message that I cannot use SendMail in ForAll.

 

What options do I have? Is it possible to use the SendMail function at all, or do I have to do a Flow instead?

 

Thanks for any input you might have!

 

1 REPLY 1
Community Support Team
Community Support Team

Re: nding multiple emails from a collection

Duplicate thread:

https://powerusers.microsoft.com/t5/PowerApps-Forum/ForAll-and-SendMail-not-possible/m-p/46187

 

Please consider send the Email under Flow, which should works.

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
thirdimage

Power Automate 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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 192 members 5,424 guests
Please welcome our newest community members: