Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Answered

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

(0) ShareShare
ReportReport
Posted on by 41

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?  

 

  • jodbowrs Profile Picture
    2 on at
    Re: How to Email a Sales Order Confirmation with sales line details?

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

  • Alex-M Profile Picture
    41 on at
    Re: How to Email a Sales Order Confirmation with sales line details?

    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

  • Verified answer
    Linn Zaw Win Profile Picture
    2,982 on at
    Re: How to Email a Sales Order Confirmation with sales line details?

    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

     

     

     

     

     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,651 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow