Applies to
- Pro
- Business
- Enterprise
Use a URL query string to prefill different default values for the same form
After you create a form, you can use a query string to give different people different links to the same form – and have the form be prefilled differently based on the link they used.
When a user accesses the form using the custom link, information from the URL prepopulates fields in the form. Prefilled forms via unique links are useful if you want to use the same form for different common scenarios; you'll create a unique link for each scenario.
You can hide fields in your form if you don’t want the user to see prefilled values, though the values will still appear in the URL.
For example, you can create different URLs for the same form and then share the personalized form with different people on your team.
Say 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 to that form with a query string that prefilled 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.
Does your team to submit the same data over and over 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 so your team knows they can use this shortcut.
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.
- Select Copy Form URL
.
- In a spreadsheet or any word processing application, paste the URL.
- At the end of the URL, type a question mark (?).
- For example:
https://app.smartsheet.com/b/form/6145a2c33c4e42e68bf53900e4a4845b?
Earlier versions of Smartsheet allowed the use of an ampersand. Current versions require that you use a question mark to add the first query string to a URL.
- For example:
- Type the value for the form field that you'd like to populate.
- For example, you want to populate the Rep field with the name of one of your sales reps: https://app.smartsheet.com/b/form/6145a2c33c4e42e68bf53900e4a4845b?Rep
Form fields are case sensitive.
- For example, you want to populate the Rep field with the name of one of your sales reps: https://app.smartsheet.com/b/form/6145a2c33c4e42e68bf53900e4a4845b?Rep
- Type an equal sign (=).
- For example:
https://app.smartsheet.com/b/form/6145a2c33c4e42e68bf53900e4a4845b?Rep=
- For example:
- Type the value you want set as the default.
- For example, you want to set the rep's name to Sally Smart: https://app.smartsheet.com/b/form/6145a2c33c4e42e68bf53900e4a4845b?Rep=Sally%20Smart
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.
- For example, you want to set the rep's name to Sally Smart: https://app.smartsheet.com/b/form/6145a2c33c4e42e68bf53900e4a4845b?Rep=Sally%20Smart
- Send the customized URL to the people whom you want to use it.
- For example, you send the link to Sally. When she navigates to this link, Smartsheet populates the Rep field with her name, so she won't have to enter it manually.
To include multiple fields in the URL, join them with an ampersand. For example, use:
https://app.smartsheet.com/b/form/6145a2c33c4e42e68bf53900e4a4845b?Rep=Sally%20Smart&ECA=sallysmart@smartsheet.com.
Include special characters in the query string
You can see a full list of special characters (referred to as escape characters) here.
URLs can’t contain spaces. To include a space or other special character using the method described in this article, you'll need to use URL percent encoding. The following table includes a few common special characters and their percent encoding values. Use these in the query string to populate the form with their ASCII values.
To populate this | Type this in the URL |
Character space | %20 |
Equal sign (=) | %3D |
Percent symbol (%) | %25 |
Number symbol (#) | %23 |
US dollar symbol ($) | %24 |
Ampersand (&) | %26 |
Grave accent (`) | %60 |
Colon (:) | %3A |
Left angle bracket (<) | %3C |
Right angle bracket (>) | %3E |
Left bracket ([) | %5B |
Right bracket (]) | %5D |
Left brace ({) | %7B |
Right brace (}) | %7D |
Quotation marks (“ ”) | %22 |
Plus sign (+) | %2B |
At sign (@) | %40 |
Slash (/) | %2F |
Semicolon (;) | %3B |
Question mark (?) | %3F |
Backslash (\) | %5C |
Caret, circumflex (^) | %5E |
Pipe, vertical bar (|) | %7C |
Tilde (~) | %7E |
Apostrophe (') | %27 |
Comma (,) | %2C |
Advanced scenarios
There are lots of different ways to use query strings. Consider the following ideas:
- 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.
- 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.
- 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.