You can now use hidden fields in forms and surveys. Hidden fields allow you to include data that can’t be seen by users when a form is submitted.
Hidden field values are passed to a form using URL parameters, e.g.: https://forms.illinois.edu/sec/1234567?name1=value1&name2=value2
Adding Hidden Fields
- In the top right navigation menu, click Forms to access your My Forms page (the same process applies to surveys).
- In the table, click the name of the form that will contain the hidden fields.
- In the form, click the Submissions tab, then click the Hidden Fields sub-tab.
- Enter the name of your hidden field and its default value. (We recommend using camelcase syntax for field names.) The default value will show in your reports if no hidden field value is submitted with the form.
- Click the Add field button. Your hidden field displays in a table.
- Enter more fields as needed and click Save when you are done. You can reorder, change, or delete hidden fields. Note that hidden fields are always placed at the end of your form. If your form is multiple pages, they will be placed on the last page.
Passing Values to Hidden Fields
Hidden field values are passed to a form using URL parameters:
- Values you pass in the URL must be alpanumeric, meaning you can only use the 26 letters of the alphabet (lowercase and uppercase) and the numbers 0-9.
- URLs must be properly encoded (i.e., spaces must be represented by %20 and so on). If you are using the text editor in Email+, encoding is done automatically.
Example 1: Using Basic Values
A form with ID number 1234567 has hidden fields for uniqueID and year:
To pass hidden field values to the form to be included in your reports—let's say it's a department ID of NH234 and the year 2019—use the following URL structure when sharing a link to your form:
https://forms.illinois.edu/sec/1234567?uniqueID=NH234&year=2019
As a result, anyone who clicks this link to complete the form will have this department ID and year listed with their other submission data in the reports.
Example 2: Using Email Variables
You have an email you want to personalize using mail merge variables. In addition, you would like to include a unique form link that contains each person's ID number. Here is what the email looks like:
To access the firstName and lastName mail merge variables, you uploaded an email group with multiple data elements to the Groups tool:
To create a unique link, you also use the personID data element as a variable and pass it to the form as a hidden field value, like so:
https://forms.illinois.edu/sec/12345670?uniqueID={personID}
Example 3: Incorporating Web Parameters
You can take it one step farther by using web parameters to prepopulate form fields with individualized data. So let's you say you added web parameters to the first name and last name form fields during setup, for example:
You could then add those web parameters to the form link and assign them values that correspond to the firstName and lastName mail merge variables:
https://forms.illinois.edu/sec/12345670?uniqueID={personID}&first={firstName}&last={lastName}
Doing this results in the following the email, unique form link, and form display: