Tips, Tricks & Best Practices

Mike_Eastwood
Key Advisor | Gold Partner
Key Advisor | Gold Partner

How to collect data from a hidden field in a Non-HubSpot Forms

We had an interesting challenge this week - using hidden fields in a non-HubSpot Form. Usually we embed HubSpot forms in websites to make it easy to control. But in this case the website was all custom bespoke code with forms on hundreds of pages.

 

We wanted the hidden field to populate a Custom Property in the Contact Record to trigger a Workflow. The data in the field is dynamically generated so it wasn't practical to create custom forms for each page.

 

If you add a hidden field to a non-HubSpot Form then HubSpot will ignore it when parsing the form data.

 

So, what we did was add a normal Text Input Field - with a dynamically populated default value - then hid the field with CSS (display: none).

 

HubSpot then parses the data in the field and updates the contact property. The visitor doesn't see another potentially confusing field and we only had to make one code change.

 

Hope this helps you.

Mike

3 Replies 3
Jaycee_Lewis
Community Manager
Community Manager

How to collect data from a hidden field in a Non-HubSpot Forms

Brilliant 💡 Thank you, @Mike_Eastwood 🙌

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

EllaSheen
Participant

How to collect data from a hidden field in a Non-HubSpot Forms

Very helpful. Thanks for sharing.

kvonloesecke
Community Manager
Community Manager

How to collect data from a hidden field in a Non-HubSpot Forms

Thanks for sharing this with us, @Mike_Eastwood!


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !