Answered

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

  • 13 May 2021
  • 6 replies
  • 2406 views

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?
icon

Best answer by Liz 30 December 2021, 16:15

View original

6 replies

Userlevel 7
Badge +5

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!

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!

Userlevel 7
Badge +5

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!

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?

Userlevel 7
Badge +6

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

 

des

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