Customize form links with query strings to provide different default values for each recipient.
When someone accesses a form with a custom link, information from the URL pre-populates fields in the form.
Scenario
Imagine a sales manager wants their team to log all client phone calls in a central, easily accessible sheet, and wants each call to include the name of the sales rep logging the call. The manager creates one base form, then gives each person on the team a different URL with a query string that prefills their name. Each team member can easily log information without having to enter the same basic details every time, and they can see all the information in one place.
Add a query string to a form URL
To build the query string for a form URL:
- In the menu bar, select Forms > Manage Forms.
- Hover over the form you want to distribute with custom URLs.
- From the Menu icon, select Copy Form URL .
- In a spreadsheet or any word processing application, paste the URL.
- At the end of the URL, do the following:
- Type a question mark (?)
- Type the value for the form field label that you'd like to populate (for example: Rep). You must use the form field label for the values to populate correctly.
- Type an equal sign (=).
Type the value you want to set as the default value (for example: Sally Smart).
For example: https://app.smartsheet.com/b/form/6145a2c33c4e42e68bf53900e4a4845b?Rep=Sally%20Smart
To include multiple fields in the URL, join them with an ampersand (&).
For example: https://app.smartsheet.com/b/form/6145a2c33c4e42e68bf53900e4a4845b? Rep=Sally%20Smart&ECA=sallysmart@smartsheet.com
To populate a Multi-Select dropdown list with multiple values using the query string, include an & and repeat the field for each additional value:
?Multi=Apple&Multi=Orange
For more than two values, continue to list the field each time:
?Multi=Apple&Multi=Orange&Multi=Banana
Things to consider
- Prefilled strings don't work when you require users to log in to use the form. Authentication clears any customization from the URL.
- Form fields are case sensitive. Keep this in mind when you add values to the URL string.
- URLs can’t contain spaces. To include a space, use %20. For other characters, refer to the special characters list at the bottom of this page.
If you’ve enabled the Allow submitter to email a copy of form submission option in your form settings, you can use query strings to automatically select this option on your form and enter a default email address. Use ECA to pass information into this field.
For example:
https://app.smartsheet.com/b/form/6145a2c33c4e42e68bf53900e4a4845b?ECA=sallysmart@smartsheet.com- Values are editable but not private. You can hide fields from appearing in the form, but the values still appear in the URL, and anyone with the link can see the URL and the data of the pre-populated values.
- If your team needs to submit the same data again, they can use the browser's back button to reload the form with the last submitted values, including prefilled values. Then they can overwrite anything they need to change and resubmit the form. Consider adding this tip in a description field on your form for your team to learn this shortcut.
- Always use the form field labels instead of your intake sheet field names for the values to populate correctly in your form. For example, if your sheet field name is Ticket ID, but what you use in the form for the label is Request ID, you need to use the string ?Request%20ID for that field to populate.
Include special characters in the query string
If you want to include a space or other special character in your URL, you need to use URL percent encoding. The following table includes a few common special characters you can use and their percent encoding values. These characters are also known as escape characters.
To populate this | Type this in the URL |
---|---|
To populate this Character space | Type this in the URL %20 |
To populate this Equal sign (=) | Type this in the URL %3D |
To populate this Percent symbol (%) | Type this in the URL %25 |
To populate this Number symbol (#) | Type this in the URL %23 |
To populate this US dollar symbol ($) | Type this in the URL %24 |
To populate this Ampersand (&) | Type this in the URL %26 |
To populate this Grave accent (`) | Type this in the URL %60 |
To populate this Colon (:) | Type this in the URL %3A |
To populate this Left angle bracket (<) | Type this in the URL %3C |
To populate this Right angle bracket (>) | Type this in the URL %3E |
To populate this Left bracket ([) | Type this in the URL %5B |
To populate this Right bracket (]) | Type this in the URL %5D |
To populate this Left brace ({) | Type this in the URL %7B |
To populate this Right brace (}) | Type this in the URL %7D |
To populate this Quotation marks (“ ”) | Type this in the URL %22 |
To populate this Plus sign (+) | Type this in the URL %2B |
To populate this At sign (@) | Type this in the URL %40 |
To populate this Slash (/) | Type this in the URL %2F |
To populate this Semicolon (;) | Type this in the URL %3B |
To populate this Question mark (?) | Type this in the URL %3F |
To populate this Backslash (\) | Type this in the URL %5C |
To populate this Caret, circumflex (^) | Type this in the URL %5E |
To populate this Pipe, vertical bar (|) | Type this in the URL %7C |
To populate this Tilde (~) | Type this in the URL %7E |
To populate this Apostrophe (') | Type this in the URL %27 |
To populate this Comma (,) | Type this in the URL %2C |
To populate this Asterisk (*) | Type this in the URL %2A |
Advanced scenarios
There are lots of different ways to use query strings. The following list provides a series of ideas for which you can use query strings.
- Dashboards: Create a dashboard with different links to the same form. Each link has query strings that use fields that control conditional logic in the form to create quick links for different types of requests that are all processed centrally.
- Formulas: Use formulas to automatically create a prefilled form and generate follow-up items, like an automated alert to send the URL to the original requestor.
- QR codes: Create different QR codes that use the same base form but have different URL query strings, and print those QR codes on stickers on different pieces of equipment. Have people scan the QR code and enter their details to create an easy equipment usage log.