cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dnewton
Regular Visitor

Using "apply to each" to compose a single HTML table and email?

Hi All,

 

I'm trying to create a flow to run on a schedule which gets a list of records from Dynamics, finds records with a null value and then builds a HTML table and emails this out.

 

I have the vast majority of the flow working fine but I can't seem to get around the "apply to each" step. I only want a single HTML table and email to be sent out with a list of all records, but I seem to only be able to have multiple emails sent out (as the "send an email" step repeats on the "apply to each" step).

 

I have attached a picture of the flow. Is it possible to have a "create HTML table" and "send an email" step? I don't want multiple emails, just 1 with a list of records on.

 

If I move the "send an email" step outside of the "apply to each" my condition no longer applies so I just get a list of all (unfiltered) records.

 

https://imgur.com/a/iKbgGkR

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-yuazh-msft
Community Support
Community Support

Hi @dnewton,

 

Please don't add a send an email action inside of the apply to each if you want to send single email, and please take a try to create the flow with odata filter in the "List records" action as below:

Capture.PNG

 

 

 

Please let me know if your problem could be solved.

 

Best regards,

Alice

View solution in original post

3 REPLIES 3

Hi @dnewton,

 

Rather than using the Apply to each on each item in your list. You should look at converting the list into HTML and then pull your send email below the Apply to each. You might want ot investigate the select action instead.

v-yuazh-msft
Community Support
Community Support

Hi @dnewton,

 

Please don't add a send an email action inside of the apply to each if you want to send single email, and please take a try to create the flow with odata filter in the "List records" action as below:

Capture.PNG

 

 

 

Please let me know if your problem could be solved.

 

Best regards,

Alice

Thank you - incredibly simple solution but works perfectly!

 

I had tried doing this without sucess as could not work out the correct way to only filter on null but your explanation was excellent.

 

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 (2,788)