How to Add Query Parameters to Form Redirects
The query parameter feature in SureForms lets you send specific form information, like a user’s first name or email, in the URL when redirecting them after form submission. For example:
https://your-website/redirected-page/?fname=john&feedback=satisfied
This is useful for transferring form data between pages or sites without storing it in a database. It also helps you create a more personalized experience for users.
For example, if your form collects a user’s first name, you can use query parameters to display their first name in the URL when redirecting them to a thank-you page. To do this:
Setting Up Query Parameters
To add query parameters to your form redirects:
- Go to “Redirect” and select either Page or Custom URL depending on your preference.
In this example, we’ll add query parameters to a page on your website but you can follow the same steps for a custom URL as well.
- After selecting the page, check the “Add Query Parameters” checkbox.
Understanding Keys and Values
SureForms uses a simple system to pass data through URLs when redirecting forms. It works with two parts: a key and a value.
- Key: A label that describes the type of information being sent.
- Value: Your custom data or the actual data entered in the form.
Note:
Note: When using query parameters with a WordPress URL as the redirect URL, avoid using WordPress reserved terms as keys. Using reserved terms like name, author, or tag can lead to issues such as “Page Not Found” errors from WordPress.
For example, if the key is “fname”, the value will be the user’s first name from the form. This makes the URL unique for each user:
Here’s how you can enter these key-value pairs:
- If you need to send custom information that isn’t part of the form data (e.g., a label like “from-page”), you can enter the key and value directly. Just type them into the fields provided.
Using Dynamic Data in Query Parameters
If you want to use information the user filled out in the form, do the following:
- First, enter the key (e.g., “fname”) in the first field. You can enter any key you prefer, but ensure it’s clear and descriptive for easy understanding.
- Click the three-dot icon next to the “Add Value” field.
- Select the form field whose data you want to use. For example, if you want to use the user’s first name, select the corresponding form field (like “Enter your name”).
- To add more than one piece of information, click the “Add” button and repeat the steps for each new key-value pair. For example, you might want to include both the user’s name and their feedback:
If you want to remove a key-value pair, simply click the trash icon next to it.
Once you’ve added all your query parameters, click the “Save” button in your SureForms editor to apply your changes.
Now, whenever users fill out your form, the data you’ve set up in the query parameters will appear in the URL after they are redirected.
Setting Up Query Parameters For Custom URLs
You can follow the same steps for a “Custom URL” here:
That’s it with this article. We hope it helps you.
For any questions, feel free to reach out to our support team. We’re always here to help!
We don't respond to the article feedback, we use it to improve our support content.