When we create a form in Easy Forms, one way we can distribute that form is with a URL. We can append a query string to the form URL such that when a person clicks the URL, information from the URL is passed into the form fields. This technique is useful, for example, if we need multiple people to fill out the same form but want to specify different default values in certain fields. To achieve this, we could create a URL that includes a unique query string for each person.
Add a Query String to a Form URL
Here’s how to build the query string for a form URL:
1. At the end of the URL, type a question mark (?). For example, type
https://demo.easyforms.dev/forms/simple-contact-form-with-recaptcha?
If your URL already has a question mark, you will need to use an ampersand (&).
2. Type in the value for the form field that you’d like to populate.
In this example, we want to populate the Rep field with the name of one of our sales reps:
https://demo.easyforms.dev/forms/simple-contact-form-with-recaptcha?text_0
Form fields are case sensitive. You can use the Field ID or Field alias.
3. Type = (an equal sign):
https://demo.easyforms.dev/forms/simple-contact-form-with-recaptcha?text_0=
4. Type the value you’d like to set as the default.
In this case, we’ll set the rep’s name to John Doe:
https://demo.easyforms.dev/forms/simple-contact-form-with-recaptcha?text_0=John%20Doe
5. Send the customized URL to the people who you want to use it.
In this example, we’d send the link to John. When she navigates to this link, the Name field will be populated with his name and he won’t have to enter it in manually.
To include multiple fields in the URL, join them with an ampersand. For example, use:
Include Special Characters in the Query String
You can see a full list of Special Characters (referred to as escape characters) here.
URLs cannot 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 |
---|---|
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) | Type this in the URL %24 |
To populate this & (ampersand) | Type this in the URL %26 |
To populate this ` (grave diacritic) | Type this in the URL %60 |
To populate this : (colon) | Type this in the URL %3A |
To populate this < (less than) | Type this in the URL %3C |
To populate this > (greater than) | Type this in the URL %3E |
To populate this [ (open bracket) | Type this in the URL %5B |
To populate this ] (close bracket) | Type this in the URL %5D |
To populate this { (open curly bracket) | Type this in the URL %7B |
To populate this } (close curly bracket) | 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, arobase) | Type this in the URL %40 |
To populate this / (forward slash, whack) | Type this in the URL %2F |
To populate this ; (semi-colon) | 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, chevron) | Type this in the URL %5E |
To populate this | (pipe, pine) | 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 |