SurveyMonkey Apply

How to Troubleshoot your Form Calculations

If you are receiving an error message within your text field or perhaps the value is not calculating to the correct value that you are trying to calculate, there are a few possibilities that may be causing these errors which are discussed in this article. The purpose of this article is to help you troubleshoot any errors that you may receive within the site.

  • Each expression is always contained within a pair of double "curly" brackets {{  }}
  • There should be a space between the first instance of the function and the last bracket
  • Variables you are using are case sensitive and are spelt correctly
  • Make sure that you have the correct number of brackets when using more complicated calculations.
  • Correct formatting for each function type is being used

You will need to ensure that the identifiers on the questions and the identifiers being used within the expression match exactly. These identifiers are case sensitive.

It is also possible that when you are making changes to your form you forget to update the identifiers correctly. In order to ensure that your formula is calculating correctly, make sure that all questions you wish to calculate from are correctly piped into the expression with the correct identifiers.

For more information, refer to How to Add an Identifier to a Question.

In more complex scenarios you may wish to pipe a value (RE: Piped Value A) into a field within your form, whether it be from the same form or another form. The issue that can arise from this, is that you will not be able to use Piped Value A within another piping variable on the same page.

For example, if the applicant provides their total expenses within a form and the value is piped into a second form. Once the expense total has been piped into the second form, you will not be able to immediately use it to perform calculations within the same page. You will need to create a new page. Therefore, the expense total will be piped in, the user can Save & Continue in the form, and the value can then be used within the second page.

For more information and a bit clearer picture of what this looks like I would recommend, referring to How to Use In-Form Piping.

When piping into Text Response or Hidden Value fields, a setting for Restore Initial Value is available. 

This is an important setting to enable when using Piping Variables or AEP as it will ensure that the field will always update when a change is made to the original field that the variable is pulling from. 

When this isn't enabled, after the applicant saves their form, their response will override the variable in the field. If they then make a change to their budget, for example, the total will remain with the first total that was saved. However, with Restore Initial Value, when they make a change to the budget, the total will continue to update accordingly.