<< Click to Display Table of Contents >> Navigation: NITRO™ Workflows > Workflow Use Cases > Use Case - Update Total Cost of Purchase |
Workflow Use Case
Update Total Cost in Purchase Request with the summarized Total Cost of Items in all related Purchase Items
Description
On Purchase Request item update, this workflow will update the Total Cost field on the Purchase Request with the summarized total cost of all related purchase items. The workflow has two actions: First it uses the Query List feature to retrieve all purchase items related to the purchase request, then a second action performs the update of the summarized total cost value.
Workflow
Add a workflow on Purchase Requests’ list Item Modified event
Action 1
Add a ‘Query List’ action to get Purchase Items related to the Purchase Request
Configure the action settings as shown in the below picture.
Query:
O365:
<View><Query><Where><Eq><FieldRef Name='PO' LookupId='TRUE' /><Value Type='Lookup'>##ID##</Value> </Eq></Where></Query></View>
To know more about Query List action go to Query List.
Action 2
Add an ‘Update Item’ action.
Calculate the Sum and assign it to ‘Total Cost’.
Syntax: QueryLisActionName##$sum([FieldPlaceHolder])