Enjoying the blog?

Can you auto-populate form fields on HubSpot using query strings?

Written by Will Troup

25 | 10 | 19

HubSpot  |  
3 minute read

You definitely can auto-populate form fields in HubSpot, via cookies and query strings if needs be. Let's get straight into it. Here’s how you can auto-populate form fields in HubSpot using query strings…

_DSF0765

When might you have to auto-populate forms using query strings?

If you’ve got a persona that will respond to your marketing emails on different devices or connections other than their own, maybe at events or they do a lot of travelling in their job, then you’ll want to use this feature.

When the cookie is in place, HubSpot will pre-populate forms anyway but you can keep every other user’s journey as smooth as possible by using query strings.

How do you auto-populate form fields in HubSpot using a query string?

Auto-populating field values in a form on HubSpot using query strings is pretty straightforward. However, it’s only possible to do within certain field types. These include:

  • Single-line text
  • Multi-line text
  • Dropdown select
  • Multiple checkboxes
  • Numbers
  • Radio select


Here are the steps you need to take within your account to auto-populate your form fields using a query string.

Copy the property’s internal name

You’ve entered your HubSpot account and you’re ready to crack on - happy days. The first thing you need to do is enter the settings icon in the main navigation bar at the top of the page.

chrome-capture (3)

Next, you’ll need to navigate towards the properties section and then click the name of a property to pre-populate values which will feature in your form. Once you’ve done that, copy in the internal name of the property.

chrome-capture (4)

Create static query strings with predefined values

You can create static query strings to auto-populate form fields by using predefined values. Again, this is a pretty simple process. First, you’ll need to navigate to the page your form is on and copy the URL

Next, add a question mark to the end of the page URL. Then, add the internal name of the property, followed by an equal sign and the value you want to auto-populate in the field. Be sure to remember that there are different rules for adding values, depending on the field type:

Single checkboxes: Query string must contain a true or false value. 

Date pickers: Query strings must contain a date value, using the following format - 1995/06/21. 

Multiple checkboxes: Query string values must match the property’s value options exactly, with a semicolon to separate the values. 

Radio selects: Query strings for radio select must match the property’s value options exactly. 

Once you’ve created the URL with static query strings, you can use it as a link within different types of content. This includes landing pages, web pages and emails.

What are some examples of scenarios where a form field might be auto-populated?

There are a couple of likely scenarios where a form field might be auto-populated with someone’s information. Some of these include:

  • Someone has previously submitted a HubSpot form which tracks cookies. Therefore, the entered information will be auto-populated when you visit a HubSpot form from the same account again. A query string wouldn’t be needed in this scenario
  • If someone has used your browser to submit the form and updated it to their values, their information will overwrite yours. A query string would be needed in this scenario.
  • Sometimes form fields auto-populate with another person’s information who has never submitted a form on your browser. This is most likely due to a forwarded email. A query string would be needed in this scenario.

Understanding how query strings work is quite complex stuff. However, we’re happy to discuss the topic further if you need any help setting up your own in HubSpot. Just get in touch with one of our experts and we’ll offer all the guidance you need. 

We’re also here to chat through anything else HubSpot related. But our brand new guide could well have the answers already. Why not download your free copy and check it out for yourself?

Download your very own version of the guide today 

From setting up your landing page templates to building up your database. Our brand new guide covers everything you need to ensure you give yourself the best chance of achieving inbound success. 

Click on the button below the receive your very own free version.

setting-up-hubspot@2x

Get your complete guide to setting up HubSpot

Download the guide today
aa