We have added variables and constants to CRM. They greatly simplify calculations in fields and work on scenarios, such as profit calculation.
How to create variables and constants
Go to the Automation rules page. On the top menu, select Variables or Constants.
In the slider, you will see a table with a list of items. If necessary, you can choose which fields to display and hide. To do this, click on the gear.
Click Create variable and fill in the field values in the slider. Save your changes.
Type, Multiple, and Visibility field values cannot be changed after creation.
How to use variables and constants
Constants and variables can be used in automation rules.
If the Visibility field is set to CRM, the variables and constants will not be displayed in tasks. If it is set to Leads, the variables and constants will not be displayed in deals.
Example of using constants and variables in automation rules
For example, we have a warehouse in Boston. After the client makes an order in our online store, we send them an email with the information about the approximate delivery time. The order picking at the warehouse never takes more than 1 day. However, the order delivery period is different: within the city, the delivery is done within 1 day, but it can take up to 3 days to deliver an order across the region.
Thus, we can specify the order picking as a constant, and the order delivery as a variable. Their default value will be 1 day.
In the Picking and shipping stage we add the following automation rules:
We use both Perform math operations automation rules to calculate the number of days required to deliver an order in the city and region. The calculated value will be saved to the Order shipping variable.
If the delivery is done within the city, we add 1 day to the order-picking period.
In the same way, we add 3 days in case of the delivery across the region.
Then we can use the Order shipping variable in the text of an email in the Send email to customer automation rule.
The variable will be replaced by the calculated number of days, and our client will be aware of the approximate delivery time.