Skip to main content

Calculated Elements

Creating a calculation between two or more fields, or create Boolean calculations

Updated this week

While in the editor of your template, you'll want to first add a Calculated Field.

Calculated fields can also be created within the dataset.

Calculations Overview

For a new calculated field, enter a Title, Description, and Placeholder text. Choose if it is visible to the user, and choose the type of calculation.

Next, for a Numeric calculation, choose the type of mathematical operation you want to perform. This adds a formula bar to the Calculations area and selects the first field, highlighting it in blue. From the Element dropdown, select the element (from this template) that you want to add to the equation.

To fill the second field of the equation, click on the empty cell to the right, then choose the Magnifying glass icon from the toolbar.

Search for another field to pull into the equation and select it in the Element dropdown.

(Example of selecting another element, clicking the magnifying glass)

Alternatively, to enter a fixed value, click on the Right arrow (>_) icon in the toolbar.

Type the fixed value in the Custom value field.

(Example of a custom value entered, clicking on the >_ icon)

​ 

You may use more than two fields in a calculation.  After you've created your initial two you can then click on any of the calculation icons to continue adding to your equation. Note that adding a very large (more than 20) number of component elements to a calculated element can cause browser errors.

To remove a field from the calculation, select the field and click on the Trash can icon.

If you add a blank or more than one that you would like to remove, click the rectangular 'Clear empty cells' button. This will remove any blanks and shift everything else to the left of the equation.

Once you are done editing all of the fields (title, description, calculations, etc.), click on the Create button.

Boolean Calculations

If you would like an element/group/page to be conditionally visible based on more than one selection, you can establish a Boolean calculation. This can be used to make a quiz and display the correct answer at the end.

In the example below, we will build a flow for validating that the correct ingredients were selected:

In each element, there are two 'correct' answers that I'd like to validate for: The two peanut butters AND the two jellies. An OR operation is also possible.

For this example, I have set each option to have a numerical value:

Values are customized in the Advanced editor.

I'm going to add a Calculated Element to the page to validate for either type of Peanut Butter. I will select the 'Yes or No' for my 'Type' and the values will default to 1 for 'Yes' and 0 for 'No':

I want '1' as the response in this calculation if the value selected is greater than or equal to three because my target/correct values are Peanut Butter (Crunchy), which has a value of three and Peanut Butter (Smooth), which has a value of four.

Filling One 1 or 0 calculation:

Filling Two will need to be less than or equal to 2, as Jelly (Grape) has a value of one and Jelly (Strawberry) has a value of two.

Filling Two 1 or 0 calculation:

We are using custom values for this Boolean calculation, but this could also be another input field on the template entirely.

Now I'll create my 'Is it a PB&J?' calculation, which will add the values selected from Filling One and Filling Two together. In this case, I will be setting my conditionally visible item to only appear if this calculation equal to 2 (a 'Yes' response with a value 1 from each previous calculation)

Finally, set your conditional visibility. In this example, I am creating a field group to appear:

The page will look like this:

I can now use Preview mode to check my work. I'll make 'correct' selections and check that the calculations are working as expected. If correct, my group will appear:

Any incorrect selections should make this group disappear/not appear at all.

Notes on Calculations

Placement is important!

  • If you would like your Calculated Field to pull data from a co-client enabled page, it need to be placed on a separate page that is not co-client enabled.

  • If you want your Calculated Field to total up entries from an 'Add More' enabled group, you need your Calculated Field to be in an 'Add More' disabled group.

  • Calculated Elements are a powerful, but advanced tool, so it is entirely sensible to need assistance. We are happy to point you to articles and videos to assist, chat it out with you in our live chat, or check with us in chat to schedule a session.

Keywords: Calculations, Calculated Field, Calculated Element, Boolean, Add, Subtract, Divide, Multiply, validate

Did this answer your question?