How can I get parameters from url and how to send API request and waiting for data | Community
Skip to main content
Answered

How can I get parameters from url and how to send API request and waiting for data

  • February 18, 2024
  • 4 replies
  • 753 views

Hi
I have 2 questions
 

  1. There is any way to transfer data by parameters inside the url
    like: https://formtest.typeform.com/to/sxcvxvc?name=Yarin
    and catch the parameters in the form change the value to the parameters in the url?
  2. there is any option to send API request with the parameters I got in the form, wait for the response of the request and show / redirect to another form by the data I got in the response?

 

thanks 

Best answer by mathio-tf

Hello @Yarin 

  1. you can use hidden fields to read values from the URL
  2. you can not make custom API requests within the form, however you can redirect your typeform to any URL (execute your custom logic at this URL and further redirect the respondent)

What are you trying to build?

View original

4 replies

Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 14950 replies
  • February 20, 2024

@mathio or @picsoung might be able to help with this one!


mathio-tf
Typeform
Forum|alt.badge.img+5
  • Typeform
  • 888 replies
  • Answer
  • February 21, 2024

Hello @Yarin 

  1. you can use hidden fields to read values from the URL
  2. you can not make custom API requests within the form, however you can redirect your typeform to any URL (execute your custom logic at this URL and further redirect the respondent)

What are you trying to build?


  • Navigating the Land
  • 1 reply
  • April 19, 2024

I have a similar request. The idea is to have a TypeForm within a Landing Page. We would ask the user to confirm certain values such as name, email, etc.  It would also ask the user for their desired tenant name (Campus in our case). The Campus has to be a unique string used as part of the domain (specifically the subdomain), for example https://acme.example.com, where “acme” would represent their Campus name.

However these Campus names must be unique. So we would like to query our API to assert whether or not the subdomain is available before building the redirect URL with hidden fields or using the Recall option available with the Pro plan.

We were planning on using one TypeForm to build the request to register the user and another TyoeForm to then register the users Campus, etc. We’ve seen the docs on how to to call the second TypeForm with values entered in the first TyoeForm but don’t see a way to request values from an external URL before passing them on to a second TyoeForm.

The second TypeForm, once completed, would redirect the user to this unique URL with their custom sub-domain and query parameters to then request an action from our backend API such as building a course within the tenant. 

Is this possible?


mathio-tf
Typeform
Forum|alt.badge.img+5
  • Typeform
  • 888 replies
  • April 22, 2024

Hello @jgwerner 

what I would suggest in your case is that you build your own functionality to confirm if the campus name is unique and still available.

I built this example where I lookup some information from Google Sheet based on responses in first typeform and then feed the values to second typeform via hidden fields:

https://mathio.github.io/typeform-embed/html/retrieve-from-google-sheet.html

You will need to build a custom API endpoint, like this one to retrieve the data from your own database.

Hope this helps.


Reply