Answered

typeform-airtable connection

  • 3 June 2023
  • 6 replies
  • 98 views

Hi,

I want to create a form to get some attributes like department and sector for a user.

than using these two filters want to filter my questions table in Airtable - which contains below columns

  • sector
  • department
  • q_id
  • question_text
  • answer_text

after filterin airtable with sector/department and order by q_id , want to create dynamic questions retrieved from airtable and write back user answers

 

icon

Best answer by Liz 5 June 2023, 16:21

View original

6 replies

Userlevel 7
Badge +5

Hi @arozbo Happy Monday! I hope you had a great weekend. We don’t have the option to pull questions from outside of Typeform, but I’m happy to share this feedback with the product team. 

Thanks Liz, after making lots of research for similar products 

I got the impression that this is not possible , without using any scripting or coding.

 

Thanks anyway.

 

Userlevel 5
Badge +3

Hi @arozbo ,


I believe I may have a solution for you.

 

You will need to setup 2 different Typeforms (one will be created manually and the other would be created dynamically).

 

Typeform 1 (the manually created one) will have 2 fields "department" and "sector", and be embedded onto your site via the Typeform Embed SDK.
On the "onSubmit" callback for Typeform 1 make an Ajax request to your server sending the submission id.

On your server retrieve the form's response from the submission id (via the Typeform API). Then use the Airtable API to retieve the relevant data from Airtable by filtering on the user's "department" and "sector".

 

Now, Typeform has the ability to create new form via their API programmatically.
You will need to use this API to create the second Typeform with  dynamic questions (based on the response returned by Airtable) and return this form URL (this will be the dynamically created Typeform i.e Typeform 2) as the response to the Ajax request.

On the callback function of your Ajax request redirect your user to the newly created form url (ie Typeform 2).
 

Basically you are creating a new form for each user (based on their preference dynamically i.e no manual intervention. It will be done completely programmatically)

 

One last step (if you wish you can implement this) is to delete this newly created dynamic form, so that you are not cluttered with too many Typeforms.

You would need to keep track on some external database the form id’s of these newly created dynamic forms.

This will allow you to delete the form whenever a user submits the form, as Typeform will notify your server (via a Typeform webhook) that a submission has been made against a form id.

At that point you can simply delete the form via the Typeform API if the form id exists in your external database.

Remember though if you delete the Typeform the response too will be lost, as such you would need to save the response of the user in some external database (only if you choose to delete the form, else there is no need to do so)

 

I know this is a lot to process, so feel free to ask any clarifications. 

Hope this get the job done for you!

Userlevel 7
Badge +5

Wow, thanks so much @Harsh ! Let us know if you use this solution, @arozbo 

Thanks Harsh !

I will try this solution and inform back. Not so easy for me, but will try my best :) 

Userlevel 7
Badge +5

Let us know how it goes, @arozbo !

Reply