How to set default hidden field values (and otherwise manipulate hidden field values)? | Community
Skip to main content
Answered

How to set default hidden field values (and otherwise manipulate hidden field values)?


Is it possible to set default hidden field values? For example, if a hidden field `source` is not defined in the form link hash, is it possible to define form logic that will give the field to a non-null value?

Related questions:

  • Is it possible to define and/or compute hidden field values based on user input?
  • Is it possible to pass hidden field values to a form using POST, rather than the link hash format?

Best answer by Liz

Hi @tilde This is a bit late (by a few months!), but we do have a solution now using text variables that may help. 

For example, you could first set a text variable in your form like this: 

 

Then, you could set a logic jump that would set the variable to a default if left blank, like this: 

Hopefully this helps!

View original

6 replies

Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 14893 replies
  • May 13, 2021

Hi @tilde welcome to the community! Happy you’re here. :grin:

You could adjust the logic jumps to either be blank like this: 

This jump should catch when the hidden field is empty. 

 

As for defining hidden field values, do you mind explaining a bit more what you’re looking to do? 

Finally, the hidden fields can only be passed through the URL at this time. 

Thanks in advance!


  • Author
  • Explorer
  • 2 replies
  • May 14, 2021

Hi @Liz! Thanks for your reply.

I currently do what you show with you screenshot. Great minds, etc! ;)

My question is whether I can define a default value for a hidden field (or other fields, for that matter). For example, if I have a hidden variable that contains a user’s language preference, can I set a default value for that variable (say, Spanish)? I could use logic jumps to ask the user their preference if the hidden field is empty, but that creates a redundant field: I’ll have both a hidden field for language and a visible field for language. When this data is displayed in results, it won’t be collated; it’ll be spread between two fields.

For hidden field computations, what I’m envisioning is a combination between hidden fields and variables. Say I’m collecting event information and a user provides start and end dates. Can I define form logic that would set a `Multi-day event` hidden field to True based on the other two fields?

I appreciate your help!


Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 14893 replies
  • Answer
  • December 30, 2021

Hi @tilde This is a bit late (by a few months!), but we do have a solution now using text variables that may help. 

For example, you could first set a text variable in your form like this: 

 

Then, you could set a logic jump that would set the variable to a default if left blank, like this: 

Hopefully this helps!


  • Navigating the Land
  • 1 reply
  • June 29, 2022
Liz wrote:

Then, you could set a logic jump that would set the variable to a default if left blank, like this: 

 

 

@Liz , I’m trying this exact solution atm and when I click the dropdown menu to the right of “Then” my only options are

Logic

  • Go to

Numerical

  • + Add
  • ÷ Divide
  • - Subtract
  • x Multiply

What has to change in order for me to be able to see/choose “Replace” as an action?


john.desborough
Forum|alt.badge.img+6
  • Certified Partner & Champion
  • 5268 replies
  • June 29, 2022

@Hanzo55 - your variable needs to be a text variable and not a numeric in order to use the replace

 

des


  • Navigating the Land
  • 1 reply
  • September 19, 2022

Hey there!

Thanks for response but it seems that it doesn’t satisfy my request:

  • I aim to send customised Typeform URL to customers using (HubSpot) data. Example : https://tutorials.typeform.com/to/nzthWI#company=XXXX)
  • Here, company could be blank data, so I need to set default value (ex: “your company”) and I do understand from the discussion above that I should use a variable instead of hidden field for that purpose.
  • But I also understand that a variable can no be populated using URL parameters (I actually tried with the logic jump trick explained above but it fails, see screenshot attached).
  • Therefore I cannot send (automated) customised typeforms to my customers, using marketing emails for instance.

Any help/workaround here please?

 


Reply