I'm new to Flow so apologies if there is something obvious I am missing.
I have managed to create a flow with daily recurrence that retrieves the current day's 'OrderHeader' data from a table in an Azure SQL DB. This data is then placed in an email as an HTML table.
The data includes a column 'OrderHeaderPaid' and I would like to include the sum of this value in the email.
I appear to only be able to show data from tables, not views (using SQL Get Rows). I looked at trying to add an OData aggregate in the Aggregate Transformation option of the SQL Get Rows action as follows:
/Order.OrderHeader?$apply=aggregate(OrderHeaderPaid with sum as SumOfOrderHeaderPaid)
The flow 'compiles' and tries to execute the Get Rows action four times and then fails.
I was thinking of using an 'Apply to Each' loop to get the value of each record and add it to a variable, but that doesn't seem a very efficient approach.
How can I simply add the sum of the current day's OrderHeaderPaid values into the email?
Thanks
Paul