Answered

Individualized surveys using API & external database

  • 26 February 2021
  • 5 replies
  • 669 views

I would like to find out of it is possible to use the TypeForm API in order to programmatically make individual survey questions that reference specific values, without using the Hidden Fields functionality.

 

For example, imagine I have a database of 1,000 customers, each of which bought 3 different items.

 

I want to create a survey that asks each individual to comment on their experience with each of their 5 items. I.e, person A gets asked to describe items A1, A2, and A3. Person B gets asked to describe items B1, B2, and B3.

 

My understanding is that I could pass those values as URL query string parameters using the Hidden Fields functionality. But in my real survey, I have about ~20 different unique values per individual.

 

What I’m thinking of doing is using the TypeForm API to just create a unique/distinct TypeForm survey per each individual. Each of my surveys will be an n=1

 

Does this sound reasonable? I will effectively create 1,000 different TypeForm surveys (one for each person), put in the 20 different custom values/questions using a Python script. When people fill out the surveys, I will collect them via a webhook and collate the results on my backend database.

Any feedback as to whether this sounds reasonable, or if there is a better way to achieve this?

icon

Best answer by picsoung 27 February 2021, 01:31

View original

5 replies

Userlevel 7
Badge +5

Hey @complete-novice 

This sounds like a fun project to use the Create API, which helps you manipulating forms.

If I had to start a similar project I would design manually a “template” form on the builder, using placeholders values where it will be dynamic ex: What do you think of {PRODUCT_NAME}?

Once you are happy with your form, you can publish it and inspect it’s structure by calling our Retrieve form endpoint on https://api.typeform.com/forms/{FORM_ID}

This should return a JSON payload. In this payload, get rid all ids and you should be able to use it on the Create Form endpoint.


To get even fancier, you can connect a webhook to the newly created form and delete the form when you don’t need it.

Hope it helps :)
Nicolas

@complete-novice @picsoung how did this turn out? I have the exact same need where I have a pre and post survey where I am asking users from survey 1 (pre) to come back after their rental experience to rate customized products in survey 2 (post). I don’t want to manually create dozens of surveys, but I am not a developer...

Hello,

I am looking into implementing a lead generation form with Typeform that will serve as our customers' initial point of contact. To streamline the process and enhance user experience, I am exploring the possibility of integrating with an external vehicle database.

Our goal is to simplify the information-gathering process for our customers. Instead of requiring them to manually input all their vehicle details, I would like to enable customers to input their vehicle's plate number, triggering an automated retrieval of the remaining vehicle information from the external database and adding them as hidden fields within the form. 

I would appreciate it if anyone could provide information on whether Typeform can be configured to reference an external vehicle database using the plate number provided by the customer.

 Is this functionality possible? i

I look forward to your response.
Xav

Userlevel 7
Badge +5

Hi @xavierbriel Happy Thursday! I added your post here where we have more information on workarounds with an external database. 

Userlevel 5
Badge +3

Hi @xavierbriel ,


I would suggest that you use 2 forms embedded on your site via the Typeform Embedd SDK.

 

In the first form you would ask your customer's to fill out their vehicle's plate number and on the onSubmit callback of the first form, submit the response id to your server for processing.


On your server fetch the vehicle information data (by parsing the  customer's response via the response id passed earlier and passing the same to your external database).

 

Now from your your server redirect your customer to the second Typeform, and pass the recently fetched vehicle data as hidden fields to this second Typeform

 

FYI To the end customer it would be appear as one continuous flow via redirects 

i.e

Typeform 1 -> Your Server -> Typeform 2

Reply