User variables have two primary functions:
- Auto enter values without user input. For example, an employee number that should be entered in every form.
- Retain values between form submissions. For example, the total number of inspections performed by the user.
Each web and mobile user has their own copy of the user variables.
User variables are available with a Premium plan.
Web users with Manage rights can configure up to ten user variables by selecting Manage > General > User variables:
- Mobile app description: The description users will see if they update variables.
- Caption: The label the user will see if they update the variable.
- Hint: An additional hint for the user that describes the variable.
- Data name: The name of the variable that is used in the form builder.
- Type: The type of data that can be stored in the variable:
- Text: Accepts any value.
- Integer: Accepts only integer numbers.
- Decimal: Accepts only numbers.
- Date: Accepts only date values.
- Email address: Accepts only properly formatted email addresses.
- Phone number: Accepts numbers, dashes, parentheses, stars.
- Text-Numeric lock: Accepts only integer numbers but formats as text. No thousands separators are used and the variable is available to Text calculations.
- Ask: Require the user to enter a value if their variable is blank.
- Edit: Allow the user to edit the variable.
- Sync: Synchronize changes to the variable between the app and the server.
Web users with Manage rights can enter initial values by editing Mobile users:
And by editing Web users:
Note: If a variable is blank, the mobile user is allowed to enter an initial value, even if Ask and Edit are not checked.
Mobile users will be prompted to enter any blank Ask variables when they open the app.
If the My info menu item is enabled under Manage > Mobile app > Appearance, mobile users can also edit variables in the app:
- User variables are available as input to Calculation questions. In this example, the employee number will be included in every form submission without requiring user input:
- User variables can also be updated by setting them as destination fields. The variable is updated in the app as soon as the destination field is set in the form. The new updated variable will be available to the next form filled out on the device. If Sync is checked, the server is updated with the new value when the form is submitted.