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?
I need to do this same thing but with SharePoint lists... anyone out there able to help?
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
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.
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.
WarrenBelz
146,651
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,997
Most Valuable Professional