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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to Email a Sales O...
Power Automate
Unanswered

How to Email a Sales Order Confirmation with sales line details?

(1) ShareShare
ReportReport
Posted on by 43

I have created a shopping cart style Power App that posts to a sales order header table and a sales line table in Dataverse.

I would like to send an order confirmation email to the user that created the order. 

I am having troubles knowing how to send an email to include the sales line rows? 

 

So far I have this Power Automate trigger based flow;

"When a row is added" - (i.e. New sales order is created) 

"List Rows" - (i.e. how do I get the sales line rows based on the Sales Order ID from previous step?)

"Send an Email (V2)" - (Send an email with the Order Header information and loop through and include all sales line rows in the email.)

 

I am stuck on not being able to include all related sales line info in the email?  

 

Categories:
I have the same question (0)
  • Verified answer
    Linn Zaw Win Profile Picture
    2,996 on at

    In your List Rows action, use the Filter Rows parameter to filter based on the lookup column by using the GUID value of Sales Order. The lookup column logical name (all small letter) needs to be prefixed with _ and postfixed with _value (e.g. _xyz_salesorder_value if the logical name of the lookup on the Sales Line is xyz_salesorder). Check out this video tutorial for more details.

    LinnZawWin_0-1694957811827.png

     

    List Rows action will return an array of values for multiple Sales Lines, so you need to create an HTML table before sending that information as an email. Check out these links for more details.

    https://sharepains.com/2020/04/02/3-ways-of-emailing-data-in-power-automate/

    https://www.youtube.com/watch?v=m0XLY8wqJas

     

    Please also make sure your Power Apps creates all records in the sales line table fast enough. Otherwise, the flow which triggers on creation of the new sales order is not able to capture all sales lines which are still being created.

     

    More robust approach would be creating the Sales Order with specific status (e.g. Draft), then create all sales lines, then at the end, the Power Apps patch the data to update the status of the Sales Order to something else (e.g. New).

    Then, the cloud flow would trigger on Update of the Sales Order when the Status is updated to New. (by using the Select Columns and Filter Rows to avoid being triggered for any other updates)

    e.g.

    LinnZawWin_1-1694958726128.png

     

     

     

     

     

  • Alex-M Profile Picture
    43 on at

    Hi LinnZawWin,

     

    This was exactly what I was after and am now able to produce the result I need! 

    Thank you so much for your quick response.

    All I now need to do is format the HTML table and all will be ok.

     

    Regards, 

    Alex

  • jodbowrs Profile Picture
    2 on at

    I need to do this same thing but with SharePoint lists... anyone out there able to help?

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard