CMS Development

hd-hs
Participant

Swapping form on landing page with HubDB

SOLVE
I am using HubDB to pull dynamic content into a single landing page. However, I need to change the form that is loaded on this page based on the URL with the rest of content coming from HubDB.

Does anyone know of a solution to this? I don’t want to create 5 different landing pages just for a form.
0 Upvotes
1 Accepted solution
hd-hs
Solution
Participant

Swapping form on landing page with HubDB

SOLVE

Thanks! Solved this in the end by creating a custom hubspot property and adding this property as a hidden field in the form. You can then pass the property into the url and this will populate the hidden fields data.

e.g. example.com?internal_property_name_here=test

https://knowledge.hubspot.com/forms/can-i-auto-populate-form-fields-through-a-query-string

View solution in original post

4 Replies 4
Kevin-C
Recognized Expert | Partner
Recognized Expert | Partner

Swapping form on landing page with HubDB

SOLVE

Hey @hd-hs 

 

Might you be able to create multiple forms, add a column in your DB with the corresponding form ID, and use hubl to place it into the page. This way the form wouldn't necessarily be based on the URL/query-string but rather data from the DB.

Kevin Cornett - Sr. Solutions Architect @ BridgeRev
hd-hs
Solution
Participant

Swapping form on landing page with HubDB

SOLVE

Thanks! Solved this in the end by creating a custom hubspot property and adding this property as a hidden field in the form. You can then pass the property into the url and this will populate the hidden fields data.

e.g. example.com?internal_property_name_here=test

https://knowledge.hubspot.com/forms/can-i-auto-populate-form-fields-through-a-query-string

Kevin-C
Recognized Expert | Partner
Recognized Expert | Partner

Swapping form on landing page with HubDB

SOLVE

Edge case alert:

What happens if the user manually types in the URL and forgoes the querystring?

 

Have you got a fallback in place?

Kevin Cornett - Sr. Solutions Architect @ BridgeRev
hd-hs
Participant

Swapping form on landing page with HubDB

SOLVE
These URLS are coming from PPC ads and therefore set from my side. Sorry, should have said! If they remove the query string later down the line I am not too worried as I am only interested in direct traffic from the ads at the moment!