Aggregate values to main record
Aggregate values of connected records to the main one
![Screen Shot 2022-08-15 at 17.00.32.png 754](https://files.readme.io/9914288-Screen_Shot_2022-08-15_at_17.00.32.png)
With the action “Aggregate values to main record”, you can aggregate values of connected records to the main one automatically when the chosen trigger is activated.
Trigger -> Action
The most important thing about a trick is understanding its conditions and actions. They have a simple generic structure:
When the condition (trigger) happens, then do (action).
Trigger -> Action
How to create
You just have to click on the "+ Automations" icon on the upper right corner of the screen to open the No code automations panel, and then on the "+ Create new automation" button:
![Screen Shot 2022-08-15 at 18.08.43.png 464](https://files.readme.io/3be1a1a-Screen_Shot_2022-08-15_at_18.08.43.png)
Select the trigger of your choice to activate the action, then select the "Aggregate values to main record" action, and fill in the options:
- Choose the tab of the records to aggregate
- For example, if you want to aggregate the sum of the items to a sale, choose the Items Sold tab
- Choose value field to aggregate from
- For example, if you want to aggregate the amount of all the items connected to a sale, choose the amount field in the Items Sold tab
- Choose the tab of the main record
- For example, if you want to aggregate the sum of the items to a sale, choose the Sales tab
![Screen Shot 2022-08-16 at 14.28.52.png 780](https://files.readme.io/44965a8-Screen_Shot_2022-08-16_at_14.28.52.png)
- Choose value field to aggregate to
- For example, if you want to aggregate the amount of all the items connected to a sale, choose the amount field in the Sales tab
- Choose the connected field that points to the main record
- For example, this will be the Sale field in the Items Sold tab
- Indicate the value of the field where the connected record points to the main record
- For example, this will be the Sale id
- Set aggregation type
- It can be Sum or Average
![Screen Shot 2022-08-16 at 14.29.11.png 780](https://files.readme.io/be758ba-Screen_Shot_2022-08-16_at_14.29.11.png)
Click on save
Updated over 2 years ago