Skip to main content
All CollectionsSurveys, pages, and formsCreate, view, and editContent blocks and tools
Form: Collect hidden values from the query string of a page or form
Form: Collect 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.

Gareth Burroughes avatar
Written by Gareth Burroughes
Updated over 4 months ago

Hidden values are only visible and accessible to you in the responses to a form, and are not visible to the respondent.

hidden-values-block.png

Before you start

Things you need to know:

  • To use hidden values, you must plan to share your form using the URL link only, and not embedded or as a pop-over.


Query strings explained

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, mykey1=mykey1&mykey2=mykey2.


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.

Problem

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!

Solution

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, for example:

https://[formlink]?staffmember=[name].

This name gets stored in the response and you'll know who needs to pick up the enquiry.

diagram-hidden-value-600.png

Insert the Hidden value block

  1. Go to Content > Surveys, pages, and forms and edit or create a form.

  2. In EasyEditor, expand the Form blocks menu on the left side.

  3. 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.

    saf_set_query_string_key.png

  4. Select the Hidden values block, and for Query string key, enter the query string key you want to use.

    hidden_values.png

  5. 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.

  6. Complete and select SAVE to save your form.

  7. Publish your form, and copy the form's URL.
    Learn how to publish a form in Create and publish a form.

  8. 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 is https://[formlink]?staffmember=Joe.


View the hidden value

Once your survey has responses, you can see the hidden value in reporting.

To view the hidden value:

  1. Go to Analytics > Reports, expand the MORE REPORTS drop-down menu and select Surveys, pages and forms.

  2. 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.

    hidden_field_reporting.png

Hide data field values from respondents

If you want to collect data you already hold in a data field for your contacts in a form response, but don't want these fields to display on the form, you can do this using the If you already have this data for a respondent drop-down menu when you assign a form field to a contact data field.

alread-have-data.png

This means that you can include, for example, an email address field, but by choosing the Hide this question option, the field doesn't show in your form, but the data is collected in your responses.

Did this answer your question?