Collect hidden values from the survey or form's query string


The Hidden value element allows you to collect a value in your responses that's taken from the query string in your survey or form's URL (thus the value isn't directly entered by the respondent).


This value is then only visible and accessible to you in the response, and not to the respondent.

What's a query string?

A query string forms part of a URL after the question mark - for instance:

It allows key-value pairs to be passed to a web application or database via a URL. You can have multiple keys and values in a query string, separated by '&' (e.g. mykey1=mykey1&mykey2=mykey2).

Here's an example use case:


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.


Setting it up

Using the scenario above:

  1. Add the Hidden value element to your form. Remember - this will show in your reporting, so put it somewhere that makes sense (placing it as the last field in your form is a good option).

  2. Click on the element in the form and set up the query string key as 'staffmember' in the side panel

  3. Optional: If you also want the value stored against your contacts, assign it to a contact data field called 'STAFF_MEMBER'
  4. Save the form as usual
  5. Generate the form's share link (which, in this case, will be used for the different 'Contact me' buttons) 
  6. Add a query string to end of the share link that corresponds with each staff member's 'Contact me' button. In Joe's case, his button's URL will be https://[formlink]?staffmember=Joe
Please note: Hidden values only work when a survey or form is shared as a link, not when embedded or as a pop-over.

Viewing the hidden value

Once your survey has at least one response, you can view the hidden value in reporting.

  1. Go to the reporting of your survey
  2. Click on the Responses tab, and open up a response. The hidden field will be shown, along with the value supplied.


The values can also be included on printed reports, and get included in exports.

Have more questions? Submit a request


  • Avatar

    This article says you can have multiple keys and values... Please can you tell me how to write that in your query string to pick up individual values which need to be assigned to separate contact data fields?

  • Avatar

    Hi Tanya. Yes, multiple keys and values are separated by an ampersand in a query string. For instance, if you have 'field1', 'field2' and 'field3' then your query string would look like this:


    Hope that helps.

  • Avatar

    Are you able to pass a time stamp in a hidden field?

  • Avatar

    is it possible to append the query to the embed script?

  • Avatar

    Hi Amir and Kellie. Thank you for your questions, which I wanted to address.

    Amir - it is possible to pass a timestamp value in a hidden field. Depending on the format of your timestamp value, you might even be able to assign it to a date/time contact data field in dotmailer. However, this should be tested effectively to make sure it works before relying upon it. And just to be clear, so there's no misunderstanding, you'd need to be generating the timestamp value from your side. Our surveys and forms tool can't automatically generate a timestamp value for you. It can, however, pass one.

    Kellie - you're not able to append the query string to the survey embed script. It has to be added to the webpage that the survey is embedded in, i.e. the URL seen in the browser address bar. Depending on how you're looking to use the hidden field value, there are other options you might be able to use. For instance, if you're looking to use it to show which webpage a survey was filled in on, you could duplicate the survey for each page and then merge the responses from reporting.

    Hope that helps.

  • Avatar

    This appears to do what it says on the tin, I can see the response from the query string within my results. However, while all other values synchronise back to our Microsoft Dynamics instance the (critical) hidden value is not.

  • Avatar

    Hi Tom. Thanks for raising this. As it stands, hidden field responses in a survey aren't synced to the Dynamics connector. We plan to make this available soon though, so look out for that!

    In the meantime, you could assign the hidden field value to a contact data field in dotmailer, and then map the contact data field to a field in Dynamics. This way it would sync for a respondent who's a contact.

  • Avatar

    Great thanks Neal! I know dates are hard to pin down but as a rough idea of when this will be available would "this year" be reasonable?

    Unfortunately pinning the result to a contact data field isn't suitable in our current scenario as each contact can respond more than once and the hidden value will change each time and so the data field will also update each time and I will lose the previous response.

  • Avatar

    Whilst I can't make any promises, availability before the end of the year is likely, yes. Keep a look out in our fortnightly release notes posted here -

  • Avatar

    Great thanks, will keep an eye out!

  • Avatar

    Hey Neal - related to this, is it possible to pass field responses out of the survey and into the redirect querystring on completion, e.g. redirect to:

  • Avatar

    Hi Stuart. Thanks for your question. It isn't possible due to the fact that personalisation like this can't be successfully included in the survey redirect URL. Personalisation can only be processed during the campaign send process, or in the rendering of a landing page.