
I have two custom tables regarding orders in Dataverse: Order and OrderItem.
Order has a TotalCost column and OrderItem a Cost column.
I’m trying to keep TotalCost on each order in sync with the sum of the order’s items’ Cost.
Since there are no triggers in Dataverse, I’m trying to use Power Automate’s triggers: When a row is add, modified or deleted.
So far so good with updating the order total when items are created or deleted.
The problem is when order items are updated, e.g., if the ordered quantity of an item is changed.
Since Power Automate’s triggers do not allow to get the old value of a field (before it was updated), I've been trying to get all the items of the order and recalculate the total amount. The problem is that after I list the order items the flow insists in having an Apply to each control at every step downward.
Question:
Is there a way to close this ‘for each row’ processing and resume the initial single-token execution, for the single order-item that triggered the flow?
Or, alternatively, is there a way to move the several items processing into a sub flow, so that my main flow executes only for the triggering single row? I spotted this article, but couldn’t find on Power Automate the Call a child flow action it mentions: https://flow.microsoft.com/en-us/blog/october-updates-for-microsoft-flow/
Thanks a lot for any help.
Hi! Regarding the Run a Child Flow action, it is only available when the flows are inside a solution. If you do not need a solution, you can use HTTP actions instead: https://flow.microsoft.com/en-us/blog/build-nested-flows/