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 Apps / Including collection d...
Power Apps
Answered

Including collection data within email

(0) ShareShare
ReportReport
Posted on by 30

Hello, 

As a part of my app, I am sending an email to the user as a sort of "order confirmation" when their order is submitted. However, i would like this email to display the items, quantities, and (if possible) item photos. I have order info stored in a collection named colOrderItems. However, this would require some sort of loop to iterate for each item in the collection. Is there a way to use a ForAll statement within an SendEmail? Here is my current code (i am specifying the sender later so that is commented out for now):

 

Office365Outlook.SendEmailV2(
varUserEmail,
"Your order has been receieved",
"Hello " & Office365Users.UserProfileV2(varUserEmail).givenName & ",<br>" &
"<br>Your order has been receieved! You will receive another email once it is fulfilled. See your order details below:<br>"
/* {
From: ""
} */
);

Categories:
I have the same question (0)
  • landonjochim Profile Picture
    256 on at

    Is there any reason why you aren't allocating this process to Power Automate? In Power Automate you could format the collection data into an HTML table and easily add it to the email.

  • Verified answer
    ANB Profile Picture
    7,252 Super User 2026 Season 1 on at

    Hi @ellaling ,

     

    Can you try this code which will show items and quantities in table format in body of email:

    "<table border='1' width='100%'>" &
    "<thead><tr><th>Items</th><th>Quantities</th></thead>" &
    "<tbody>" &
    Concat(colOrderItems, "<tr><td>" & items & "</td><td>" & quantities & "</td></tr>") &
    "</tbody></table>"

    I am consider that there is column name in your collection named as items and quantities , if not then change the name accordingly.

     

    Final code of body will look like:

    Office365Outlook.SendEmailV2(
    varUserEmail,
    "Your order has been receieved",
    "Hello " & Office365Users.UserProfileV2(varUserEmail).givenName & ",<br>" &
    "<br>Your order has been receieved! You will receive another email once it is fulfilled. See your order details below:<br>"
    "<table border='1' width='100%'>" &
    "<thead><tr><th>Items</th><th>Quantities</th></thead>" &
    "<tbody>" &
    Concat(colOrderItems, "<tr><td>" & items & "</td><td>" & quantities & "</td></tr>") &
    "</tbody></table>"
    /* {
    From: ""
    } */
    );

    Give a try on this and do let me know.

     

    Also, for image not sure on that part, where is the images saved?

    ------------------------------------------------------------------------------------------------------------------------------

    I hope this helps.

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs up.

    Thanks,
    ANB

  • ellaling Profile Picture
    30 on at

    SendEmailV2 allows for HTML formatting as well, wasn't sure if that was how I should approach or not. Thank you!

  • landonjochim Profile Picture
    256 on at

    Reason why I suggested Power Automate is because of the "Create HTML Table" action. You could pass your power apps collection to the workflow in JSON. Then in the workflow, Parse the JSON and create the HTML Table. Then include that HTML Table in your email. Could also easily loop however you need to (going back to your original post regarding ForAll and loops).  

  • ellaling Profile Picture
    30 on at

    Thank you so much, this worked! The images are also added to the collection but it looks like image type is not supported to be displayed in this manor so I'll just leave them out, not super important to have them.

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 207 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 150 Super User 2026 Season 2

Last 30 days Overall leaderboard