Skip to main content

How to create a Numeric Expression

Updated over a week ago

In BlockSurvey, you can create numeric expressions to perform calculations using the scores assigned to a question, answer options, values from other expressions, or assignments.

Here is a Computer Needs Survey asking for the budget price per unit & the total number of computers required to calculate the total price.

Here’s how to set a Numeric Expression.

  1. Navigate to the Design tab & create your survey in the Builder.

  2. Go to Settings → Assignment & Formulas → Numeric Expressions.

  3. Click the Create Expression button.

  4. Enter an Expression Name.

  5. Write your expression using numeric operators and references. To recall answers, expressions, or assignments, type @ or click the Recall button and choose from the dropdown.

  6. You can also define an expression using logic-based conditions by clicking Add Condition. Once you have created the numeric expression, click Validate and Save.

  7. You can use the expression name for further calculation, or you can recall the expression name in the Thank You screen. Publish and test the survey.

Note:

While creating your numeric expression, you’ll find two optional checkboxes:

  • Recalculate expression on the results screen
    Enable this if the expression needs to update dynamically on the results screen. Useful when answers or logic might change after submission.

  • Evaluate once and fix result
    Enable this if you want the expression to run only once per response and fix the result. Ideal for use cases like generating a random number or a unique identifier.

Troubleshooting Tips

  • Expression Order Matters:
    When referencing another expression, it must be listed above the current one. Expressions below are not yet defined and can’t be used.

  • Reorder Expressions:
    Use drag-and-drop to rearrange the list of expressions. Always ensure dependencies are placed earlier to avoid evaluation errors.

Give it a try!

Whether you’re calculating scores, building formulas, or assigning unique values, numeric expressions help you customize your surveys with precision and ease.

If you are still running into issues, contact us at [email protected] at any time.

Did this answer your question?