web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Apply to each, compose...
Power Automate
Suggested Answer

Apply to each, compose, to output into one HTML list to go in one email

(0) ShareShare
ReportReport
Posted on by 27
Hi
 
I am trying to build a flow that will create a list of emails that are within an email inbox sub folder. I am trying to get it to pull information from those emails so I can then add them to a HTML table and email out. 
 
I want one HTML table and one email to be sent. 
 
In the screenshot I am using HTML to text to pull the body of the email, and then compose to trim split information to extract the SharePoint list ID that is in there, and then the item name. I have no problems with these functions working. I am having problems getting these outputs into an HTML table. If I create it within the apply to each, it will create a table for each item. I can't reference the compose outputs outside of the apply to each as they are contained within. I have seen a couple of other posts with this issue and answers, but the more important screenshots of how they did it are missing - and that is the only detail they offered in their answer.

Can anyone help please? I am new to using functions and operations where code is needed so please go easy on me.
 
Thanks
 
Categories:
  • Suggested answer
    David_MA Profile Picture
    15,681 Super User 2026 Season 2 on at
    I am not sure how I see that you are creating a table in the Apply to each action so I am not sure why what you are doing is not working. However, I would create a string variable at the start of your flow named Rows. Then in the Apply to each, use the Append to string value to create each row for the table (e.g., <tr><td>Whatever goes here</td><td>Something else</td></tr>.
     
    Then in your e-mail, put it into HTML mode and code the <table>, </table>, <th>, </th> in the body, and insert the variable with the rows in the appropriate spot.
  • Suggested answer
    Pstork1 Profile Picture
    69,665 Most Valuable Professional on at
    There are two ways you can go about this.
    1) If you use Outputs('Name of the Apply to Each Compose') outside the apply to each you will get an array of the Compose values inside the apply to each.  You can use that array to create an HTML table.  If you have more than one loop that won't work because you will end up getting an array of arrays with the values.
     
    2) The other option is to append the values to an Array Variable inside the loop and then use that Variable outside the loop to create the HTML table. That gives you more control but is a bit slower than using Compose.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 330

#2
11manish Profile Picture

11manish 282 Super User 2026 Season 2

#3
Henil Profile Picture

Henil 123

Last 30 days Overall leaderboard