How to insert dynamic variables/text from an external AP ? | Community
Skip to main content
Answered

How to insert dynamic variables/text from an external AP ?


Hi Everyone , I’m building a form with typeform which has dynamic displayed text depending on a hidden field product_id , this is the flow:
1 - User clicks on an url typeform…./?product_id=id
2 - Typeform should retrieve data from an external API to diplay the text in typeform depending on the returned data.
3 - Each product has a price (returned in step2) , that price will be used for a checkout with stripe.

I can use the other fields as hidden fields but not the price because anyone can change it in the url and pay whatever he wants to pay.

How can I achieve this ?
Thank you

Best answer by Liz

Hi @Skander Welcome to the community! Happy to have you here. Sounds like quite the form you’re building! What products are you selling in the form? 

It isn’t possible to connect to an external API, so you would need to have all the pricing/products set in the form. Though, you could use logic jumps to show the specific pricing/product as it applies. 

View original

5 replies

Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 14960 replies
  • Answer
  • April 4, 2022

Hi @Skander Welcome to the community! Happy to have you here. Sounds like quite the form you’re building! What products are you selling in the form? 

It isn’t possible to connect to an external API, so you would need to have all the pricing/products set in the form. Though, you could use logic jumps to show the specific pricing/product as it applies. 


  • Author
  • Explorer
  • 2 replies
  • April 5, 2022

Thank you @Liz for this quick answer. 

I’m selling digital products (trainings). Each user will register for a paid training. I can’t create a form for each training because there are a lot and they are created on another platform.

I’m thinking of :
- Get the data from the API and creating a form on the fly for each user.
- Setup a Webhook to register the data to the same API after a user has submitted an answer and because I don’t want to have thousands of forms so I have to delete it after each answer.

So I have two questions :
- Is that a good solution ?
- Can I create a form on the fly and setup a stripe payment with and custom design via the API ?

 


Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 14960 replies
  • April 6, 2022

Hi @Skander Ah, thank you! Talk about a fancy solution! @mathio or @picsoung might have better opinions on this since they know more about the API and its capabilities than I do. 

As for the API itself, you can find the documentation here, which will outline what you can/can’t do with the API. 


picsoung
Typeform
Forum|alt.badge.img+5
  • Developer Advocate @ Typeform
  • 390 replies
  • April 12, 2022

Hi @Skander 
I guess it really depends on the number of products you are selling and how complex you want your form to be.

If you are looking for a “one size fits all” type of scenario, you may be able to achieve this using a combination of hidden fields, variables, and logic.

But your solution to create forms on the fly, could work too :)


  • Author
  • Explorer
  • 2 replies
  • April 20, 2022

Thank you @Liz and @picsoung 


Reply