You can use Single Input questions with default expressions or Expression (read-only) type questions to calculate values for other questions. This can be helpful for creating logic or calculating the answers to custom variables in a standardized way.
Tip
You can hide calculations from respondents by toggling “Is Visible?” OFF.
BMI (pounds and inches)
You may want to create a BMI calculator instead of asking respondents to use an external calculator. This can ensure that BMI is being calculated the same way every time.
- Create a “Panel” question named BMI Calculator
- Create a “Single Input” question type for Weight (pounds)
- Open up the “Properties” panel on the right
- Under the “General” section, fill in the word “weight” in the Name field
- Create another “Single Input” question type named Height (feet)
- Open up the “Properties” panel on the right
- Under the “General” section, fill in the words “height_feet” in the Name field
- Create a third “Single Input” question type named Height (inches)
- Open up the “Properties” panel on the right
- Under the “General” section, fill in the words “height_inches” in the Name field
- Create an “Expression (read-only)” question type named BMI (red)
- Open up the “Properties” panel on the right
- Under the “General” section, in the “Expression (?)” field, type in the equation: “ ({weight} * 0.453592) / (((({height_feet} * 12) + {height_inches}) * 0.0254) * ((({height_feet} * 12) + {height_inches}) * 0.0254))” (green)
- In the “Display style” field, change the dropdown to “decimal” (purple)
- Click the “Save Survey” button
Current Age
Users can calculate a respondent’s age based on their date of birth. This newly calculated age can be tied to the participant profile card and be used in logic statements throughout your survey.
- Create a “Single Input” question
- Open up the “Properties” panel on the right
- Under the “General” section, enter “Birthday” in the Name field
- Change the “Input type” dropdown to “date”
- Create an “Expression (read-only)” question
- In the “Expression (?)” field, type in “age({Birthday})” (green)
- Click the “Save Survey” button
Today’s Date
Surveys can automatically calculate today’s date. This can be helpful if you’re using surveys to collect consent and require the date signed. Users can also collect the survey completion date to automate a thank you or next steps email.
- Using the Toolbox, add a ”Single Input” question (red) to the survey
- Open up the “Properties” panel on the right
- Under the “General” dropdown, change the “Input Type” to “date”
- In the “Properties” panel, scroll down to the “Logic” dropdown
- In the “Default value expression” field, type in “today()” (red)
- Save your survey
Warning
If you use an Expression (read-only) type question, the date collected will always represent today, i.e. if a participant submits a survey on 8/15/2022, today() would be 8/15/2022. If you view that same survey on 9/8/2022, today() will be 9/8/2022.