A VARIABLE is an essential component that you need to set up in your template if you want to perform calculations.
Essentially, setting a variable is the first step you need to take for any calculation. If your template doesn't have a variable, you won't be able to add calculations.
For example, imagine you have a template designed to streamline your organization's economic proposals. You can set up a calculation so that a specific amount, let's say X€, is added incrementally based on the chosen services, until you arrive at the total service cost.
1️⃣ But hold up, your first task is to establish a base value for calculations, which we refer to as VARIABLE.
💡 A variable represents a base value, which can change and evolve through calculations based on the answers to various questions.
For example, if we create the "price" variable and set its default value at 0. This value can evolve according to the answers given to the form, through calculations.
So, how can I set up a variable in my template?
1️⃣ First, either create a new template or choose an existing one, and then click on Edit template.
2️⃣ In the EDIT tab of the template, you will see the Variables tab next to the Content and template Settings tabs.
3️⃣ Hit the ➕ Add variable button. A new window will pop up, allowing you to set the (i) name and (ii) initial value of the variable.
⚠️ When naming your variable, bear in mind:
You cannot use accents in the references.
For long references, avoid spaces between words - use an underscore "_" (e.g., use 'company_name' instead of 'company name')
Do not use symbols other than the underscore
It cannot start with numbers or use only numbers
Your variable name should not duplicate any reference from the parallel.
If you still don't know what references in Parallel are, read this article 📖.
4️⃣ You got it! You can now perform calculations in relation to this variable.
How can I edit or delete a variable?
Once you've added a variable, you can't change its name, but you can adjust the initial value.
To do this, go to the edit button, next to the variable:
A new window will appear, where you can either delete the variable or modify its initial value.
⚠️ Remember, you can't delete a variable that's being used in a calculation. You'll need to remove the calculations from the fields first.
Also, note that, their edition is subject to that of the template/parallel. That is, if the edition is restricted or you do not have editing permissions in the template (only reader) they cannot be edited.
How can I see the value of a variable?
To view or display a variable's value in your template, you can:
Copy the simple reference: {{ variable }}
This enables you...
Additionally, you can use the formulas we provide, which you can copy from the manu available next to the variable:
Formulas:
Current value: {{ variable.before }} – It will show the value of the variable, taking only into account the configured calculations up to the point where you copy and paste the variable. If the field where you copy the variable has calculations, it will also take them into account.
Final value: {{variable}} – This will display the total result of the variable, taking into account all the calculations in the template, based on the given responses.
What happens with the parallels of a template with variables?
Variables in the parallels
Here, we explain what you can do with variables when creating a parallel from a template that has them set up.
► From the EDIT tab of a parallel you can edit and delete variables as in a template.
Note that, their edition is subject to that of the template/parallel. That is, if the edition is restricted or you do not have editing permissions in the parallel (only reader) they cannot be edited.
► From the REVIEW tab of a parallel you can see the value of your variables under the signature box:
This value is the Final Value or simple reference, that is, it will show you the total result of the variable, with all the calculations applied in the parallel according to the answers that are given.