Learn to use the hidden value block to get hidden values from the query string of a page or form.
The Hidden value element lets you collect a value in your responses that we take from the query string in your form's URL. This value is only visible and accessible to you in the response, and not to the respondent.
The query string forms the part of a URL after the question mark:https://www.mywebsite.com/?mykey=myvalue
It allows key-value pairs to be passed to a web application or database using a URL. You can have multiple keys and values in a query string, each separated by
&, for example,
Hidden values use case
This use case explains how a user might use hidden values to direct responses to individual staff members from a form.
You have a list of staff on your website, and each staff member has a Contact me button, linking to a form that collects a visitor's contact and enquiry details.
However, how will you know which staff member they wish to contact? You could create a form for each staff member - but that's a lot of unnecessary work!
Create just one form but make use of a query string key-value pair in each button's link to provide the staff member's name, e.g. https://[formlink]?staffmember=[their name]. This name gets stored in the response and you'll know who needs to pick up the enquiry.
Before you start
Things you need to know before you start:
- To use hidden values, you must plan to share your form using the URL link only, and not embedded or as a pop-over.
To add a hidden value block to your page or form:
- Go to Pages and forms and edit or create a form.
- In EasyEditor, expand the Form blocks menu on the left side.
- Drag the Hidden value block onto the EasyEditor canvas.
Remember, this shows only in your reporting, so put it somewhere that makes sense, for example, the last field in your form.
- Select the Hidden values block, and for Query string key, enter the query string key you want to use.
- If you want the value stored against your contacts, assign it to a contact data field.
In the use case above, we would assign it to the STAFF_MEMBER data field.
- Complete and select Save to save your form.
- Publish your form, and copy the form's URL.
To learn how to publish a form, check out the article Create and publish a form.
- Add your query string to end of the share link.
In our use case example, this relates to each staff member's Contact me button. In Joe's case, his button's URL will be https://[formlink]?staffmember=Joe
Once your survey has responses, you can see the hidden value in reporting.
To view the hidden value:
- Go to Pages and forms > Reporting.
- Find your form and in the Form responses column, select the number to see the responses.
The hidden field is shown, along with the value supplied. The values are also included in printed reports, and exports.