Answered

Hidden fields for external link


Userlevel 1

Hi Typeform community,

 

I’m building a survey to test a feature on our website. The user answers a few questions in Typeform, and then a link opens a tab to our external website. After testing the features, they manually close the new tab,  and finish the survey on Typeform. 

Is there a way to include the hidden field in the link to our external website? For example, how could I pass the hidden field “userId” in a url like this? www.ourwebsite.com?userId=123.

This would let us know which user was testing the feature. I’ve figured out how to add hidden fields in the text of a question and at the end of the survey, but the feature to add a link within a question doesn’t seem to recall the hidden field.

 

Thanks,

Shouvik

 

icon

Best answer by mathio 27 April 2021, 20:45

View original

27 replies

Userlevel 7
Badge +5

Hello @shouvik ,

I think you should be able to use a “statement”  question and just type in the URL like this:

www.ourwebsite.com?userId=@user_id

Example: https://form.typeform.com/to/sqbV7wTo#user_id=123

 

Userlevel 1

Hi @mathio,

Why I try that approach, the hidden field isn’t populating in the external link. The link opens, but the url is coming as

https://form.typeform.com/to/sqbV7wTo#user_id=user_id

 

Note - I’ve tested the hidden field does make it into the responses at the end of the survey. I just can’t get it to appear in a link to an external site. 

 

Userlevel 7
Badge +5

Does the link in my example form not work for you? I tested in multiple browsers and it works.

As I was entering the domain I added the `@` variable for hidden field:

Enter URL, type @ to see available variables

 

Select the variable for hidden field

 

Userlevel 1

Thanks @mathio! This worked for me.

 

Note for anyone else who is stuck: I was trying to highlight text and add a url, rather than write the url directly into the question. When I highlight text and add the url, the hidden fields don’t appear. 

 

 

Badge

This isn’t working for me. I have a situation where the entire url ( less the http:// bit) is filled from a hidden field. The text is showing correctly (http://{textfromhiddenfield}) but it isn’t presenting as a clickable link. I’m entering it at Shouvik suggested above.

Userlevel 7
Badge +6

@Jules - this is form another user

can you please share a screen shot of what you are trying to do and pointing out the error? 

 

that will help us troubleshoot the issue 

 

des

Badge

Really, it isn’t a URL as such ,a bad choice of phrase on my part -  it’s an IP address - for example http://192.168.2.1 is this the cause of the issue? 

I’ve tried sending the entire  ‘http://192.168.2.1’ as hidden field, and having http:// in the question body and just sending the IP address in the hidden field, the results are the same - the text is displayed correctly but no clickable link is presented. 

 

Badge

n00bie here. I am trying to do this hidden field to external URL also...but running into issues.

The url is redirecting the correct page...but the URL is showing “_____” instead of the email address. (Screenshots attached)

What am I doing incorrectly or missing?

 

Badge

I figured it out! Just posting my findings for closure...in case anyone else is stuck on this.

I was using the “@email” hidden field instead of the “@(the page I was collecting the email from in the quiz)”.

 

Once I changed that, the url passes it on perfectly.

 

Userlevel 7
Badge +5

Glad to hear you were able to figure it out, @jerky ! Thanks for sharing your solution. :grin:

Userlevel 1
Badge

Hello. I can’t seem to use two hidden links within the same external link. Is this a limitation of typeform? Thank you

Userlevel 7
Badge +6

@fredo - welcome to the community.. can you share a screen shot of what you are trying to do, that will help us troubleshoot

des

Userlevel 1
Badge

Thanks for the reply John. Please have a look at this screenshot. Essentially, I want to embed two hidden fields in order to redirect to a whats app contact (I need the number and some text). The external link only takes my input until the phone number. I have also tried switching the two hidden fields but it doesn’t work either. Thanks

 

Userlevel 7
Badge +6

@fredo - looks like a couple of things:

  • syntax to add fields to a url is “#fieldname=xxxxx&fieldname2=xxxxx” - try that approach 
  • also.. a hidden field is typically referring to something that is passed INTO a typeform ie a name and address coming into the form in a URL string (fieldname and fieldname2 in the example i just gave. 
    • you need to create a hidden field inside the typeform advanced logic area to accept and capture the data being passed into the form - and it needs to be the same name as is in the inbound url string
  • if you are trying to create a redirect upon completion option, then use the toggle in the settings area to turn on the function and create your link there, using the + sign to select from variables (both hidden and custom) and answers to questions to incorporate into the URL.. see the image below
  • that should help you build the URL 

des

Userlevel 1
Badge

Hi John.

  • syntax to add fields to a url is “#fieldname=xxxxx&fieldname2=xxxxx” - try that approach
    Yes, this is the syntax to pass hidden fields into a typeform. It’s what I am using to pass hidden fields into the typeform.
  • also.. a hidden field is typically referring to something that is passed INTO a typeform ie a name and address coming into the form in a URL string (fieldname and fieldname2 in the example i just gave. 
    Yes, correct.
    • you need to create a hidden field inside the typeform advanced logic area to accept and capture the data being passed into the form - and it needs to be the same name as is in the inbound url string
      Yes, you are right.
  • if you are trying to create a redirect upon completion option, then use the toggle in the settings area to turn on the function and create your link there, using the + sign to select from variables (both hidden and custom) and answers to questions to incorporate into the URL.. see the image below
    No I am not trying to create a redirect on completion.

Perhaps my precious message wasn’t clear. I want to use my hidden fields (which are passed into my typeform correctly, as you explained above and which, by the way, are working perfectly fine) in an external link.

The external link is accepting only one hidden field, not more than one. So my question is: is this a limitation of typeform? Or is there a way to make an external link accept two hidden fields?

 

If you like, you can replicate my use case doing the following:

  • Pass into a typeform two hidden fields
  • Open that typeform using the following url (fieldname and fieldname2 in the example you just gave): mytypeforumurl.com#fieldname=xxxxx&fieldname2=xxxxx
  • Now create a question or statement or anything you like best, and try to add an external link. The external link uses the two hidden fields that were passed into the typeform (fieldname and fieldname2 in the example i just gave)
  • As an example you can try adding the following link to your typeform: www.example.com/@fieldname&@fieldname2
  • You will notice that the external link will only accept the first of the two hidden fields in the external link, namely the rendered link within the typeform will be: www.example.com/@fieldname where fieldname will correctly use the value of that fieldname.
  • However, the second fieldname won’t be taken into the external url
Userlevel 7
Badge +6

@fredo - you are correct that it won’t append the two variables together - this has been raised to the product team to allow for the ability to ‘append’ variables together to build out longer variables. 

you can pass to a site based on using the redirect and it will send the details: ie https://example.com#name=”enter first name”&phone=”put in the phone number” where these are both short text answers from a form or https://example.com#name=”firstname”&phone=”phonenumber” when they are hidden fields available within the typeform.. 

 

Userlevel 1
Badge

Thank you, unfortunately redirect won’t work for me.

Do you have any clue on whether this feature (the possibility of adding multiple variables to a link) is on the roadmap of the product team? And if yes, when?

Userlevel 7
Badge +6

@fredo - someone from Typeform will have to answer that one.. 

 

des

Userlevel 1
Badge

Perhaps @mathio or @Liz who were active in this post could help?

Userlevel 7
Badge +5

Hi, I just tested this and I can add multiple variables into a single link. It populates the variables correctly.

What am I missing here?

Userlevel 1
Badge

Hi @mathio I was inquiring about hidden fields passed into the Typeform, not variables created in the Typeform, but I guess this is not possible.

Thanks.

Userlevel 7
Badge +5

@fredo Just to be sure, you are trying to display this link in the form, right? something the user would click on?

And not using the “redirect on completion” or the “button link” option.

You say it only takes the first hidden field, could it be because the second parameter contains some characters that might break the link?
What would be an example of a valid link?

Userlevel 7
Badge +5

I think you are right, this seems to be broken for multiple hidden fields.

When I create a link like this:

Link with 3 hidden fields

I get this link:

Result in typeform

 

I will raise this with respective product team.

Userlevel 1
Badge

@picsoung Please see my posts above, here are the two direct links for your convenience.

@mathio Yes, so it seems.

Thank you

Badge +5

I was doing a monthly review of community discussions and noticed this one here. Wondering if there’s any update @mathio 

cc @Liz 

Reply