Answered

Would like to create a logic jump based on if a hidden field value is equal to a user entry, is this possible?

  • 12 November 2021
  • 5 replies
  • 85 views

For example: 

if userEntry is equal to hiddenField, jump to nextPage, else jump to errorPage.

Is this possible?

icon

Best answer by john.desborough 13 November 2021, 05:18

View original

5 replies

Userlevel 7
Badge +5

Hi @ember Happy Friday! I hope you’re excited for the weekend! It is possible to setup logic jumps based on hidden fields. :grinning:This article here can walk you through setting this up. 

Not my question.. as I wrote, I’d like to test whether the hidden field value is equivalent to a user-entered value. Unfortunately, doesn’t look like Typeform supports this.

Userlevel 7
Badge +6

@ember - Typeform will do this but you need to structure the logic in order to do so

try this link: here

this simple example takes two typeforms to demontrate that it will work. 

  • the answer from the first question (on a separate form) is passed to the second form/question as a hidden field
  • you are then asked to enter a value in a text field
  • the value you enter is compared with the hidden field
    • if the text entry matches choice A from the first question, go to statement 1
    • if the text entry matches choice B from the first question, go to statement 2
    • if it matches neither, go to statement 3

i created a hidden variable in the second form/question to receive the data passed from form 1

when i published the second form, the hidden field requirement is added to the share link 

in the first form, i redirect upon completion to the share link of the second form BUT i replace the xxxxx in the url string with the field name 

  • here is the structure of the link that was created in the second typeform with the hidden field syntax:
  • in the first form, when setting the redirect upon completion link, paste the link from the second form (not my desborough.yaddayadda example), delete the xxxxx characters and click on the little plus (+) sign in the corner to choose the question/answer to add the field - see the image below
    •  

the logic rules for the second form look like this: 

that should prove to you that this can be done.. 

cheers

 

des

Yes, it will work with a known amount of variables. But it will not work to say, verify a user’s email address by asking them to enter it and then check whether this entry matches a hiddenField value. 

Userlevel 7
Badge +6

define hidden field value in the context of how Typeform does them. 

If you are meaning that you want to have a dataset lookup function as your ‘hidden field’ then that will not work within ‘native typeform’. 

if you pass an email in the url as a hidden field into typeform, say via an email blast from your CRM, and ask the user to enter their email address, you can validate it against what was passed then and there. bob’s your uncle. 

if you want to have them enter the email address (in one typeform) so that it can be picked up by the API onSubmit and run a routine that checks the email against an external data set and then sends the user back to another typeform in the process, you can do that as well. 

Reply