With the new forms we have powerfull logic to show/hide fields depending on the value of other fields. I’m wondering whether there is a way to also change the default value of fields, depending on the value of other fields.
For example, we have a form that we use for lead capturing during live events. Here we capture the contacts persona (e.g., student or tester) as well as segmentation (e.g., interested in “student events” or “software testing newsletter”). The segments are the same 90% of the time, but different for each persona. So it would be awesome, if I could configure a different default depending on the persona field, to reduce manual steps during live events.
Is there a way to do this?
Hi @svamann,
Changing default property values based on conditional logic isn’t possible at this point.
An effective approach is to embed the form and use a small JavaScript snippet to set the default dynamically. Forms | Frequently Asked Questions
Within HubSpot: If your personas are limited in numbers, create separate “Segmentation” properties per persona and use form logic to show the relevant one based on the selected Persona.
Also, can you clarify what does this mean?
The segments are the same 90% of the time
If this helps, feel free to mark it as the solution
and give it an upvote
!
Thanks for the suggestions with the embedding and some custom code. I was thinking about somehow setting default in a post-processing workflow, but it’s really ugly as users cannot see this when filling out the form.
Also, can you clarify what does this mean?
The segments are the same 90% of the time
For each persona, the segmentation is the same most of the time. Or in other words, the segmentation mostly depends only on the persona, with only a few exceptions. Does that make sense?
Hi @svamann
You can’t dynamically change defaults inside HubSpot forms with logic — that part isn’t supported.
A practical workaround (besides JS or duplicate properties) is to use prefill links with query strings. HubSpot lets you pass field values into a form via the URL.
Example: https://yourdomain.com/landingpage?persona=Student&segment=Student%20events
When someone hits that link, “Persona” and “Segment” load already selected. At live events you can hand out different QR codes/links per persona, so reps don’t have to touch the Segment field at all.
Hope this helps!
Having a different link for each persona is not an option for us. We need to dynamically update the form based on the selected value.
Okay, so using a different link for each persona isn’t an option, the only way to make the form update live is to embed it on your site and add a small JavaScript snippet. That way, when someone picks a persona, the other field can update right away and show the correct default.
For non-dynamic cases, HubSpot also lets you prefill fields with query strings: HubSpot KB – Auto-populate form fields.