How to Use Form Variables and Formulas
FormCrafts allows you to use form variables to show form input in many places in your form workflow. Example, you can:
- Use the responder's name in the email subject
- Show a summary of user input on the success text
- Perform basic math operations to calculate price, or quotations
- Explain the user how their total was calculated
A field can be referenced using its field ID, which is unique to each it and looks like this: field32
A field can also be referenced using its label, like Your Name
To reference the field we use the field ID or field label enclosed in square brackets, like [field32] or [Your Name]
When working with prices and quotations, prefer to use field IDs.
Form variables can be used in custom text fields, form success text, hidden fields, email subject, email content, and other places when configuring add-ons.
How to Use Form Variables
Let us learn with an example.
Create a new blank form. Add a one-line-text field labelled Your Name. Add a checkbox field with the label Choose Cake. The Option List for the Choose Cake field would look like this:
The string before == is the price or value of the option, and the string after == is the text visible to the user.
Now we will add a Custom Text field with the shown content:
Note that we use field IDs to reference fields that contain price or value, and field labels for other fields like Name. For math formulas, you can only use field IDs.
You can preview the form and see the form variables in action.
More Form Variables
There are form variables, aside from field values. Certain variables become available once the user submits the form.
This contains a summary of all info entered by the responder. This is useful for adding to email content.
|A unique numeric ID given to the response
|Unique numeric ID of the form being submitted
|Name of the form being submitted
|Date and time returned in 24-hour format
|Date and time returned in 12-hour format
|The URL of the form page
|Title of the form page
|Country of the responder
|Division or province of the responder
|City of the responder
|Time taken (in seconds) to fill and submit the form
|Random alphabetic string of length 10
|Random numeric string of length 10
|Random alphanumeric string of length 10
In addition, certain add-ons have their own form variables. Example, if you are using Zendesk you have access to the variable [Zendesk Ticket ID].