Calculating from Lists

Hello,  I am currently at a point where within my application I need to calculate the total sum in dollars for an order, each unit ordered returns its “line item cost” but when I currently use a microflow to call the list from orderline/order, it is calculating the values of all items from all orders, my question is how do I best make it calculate just the total for the order in-process and not all of them ever made.  Thank you in advance. 
2 answers

If you want to calculate the orderlines for just one order, you will need to use your current order as the parameter for your retrieve list action. Like this: 

[orderline_order = $order], where $order is your current order.

Or use ‘retrieve by association’ from your current order, but note that this will also retrieve orderlines that have not yet been committed to the database.


Based on your explanation, you want to get the sum from a sub-set of objects. this can be achieved by

  1. Retrieve the Order objects by applying XPath constraint (to filter only in-progress orders)
  2. Use an aggregate list activity to get the sum of the required fields (order amount field). The input for this aggregate list is the list retrieved in step 1.