Answered

how can I index answers?

  • 11 February 2022
  • 7 replies
  • 70 views

Userlevel 1

hiya,

 

Hi, I'd like to know how to index answers in typeform, so I can easily create user databases for analytics.

 

Right now we do matching with strings, which is complex and clunky.

 

I know typeform now indexes questions.  But can we index the multiple choice or multiple selection answers, so each option has a unique identifier?

icon

Best answer by mathio 14 February 2022, 22:34

View original

7 replies

Userlevel 7
Badge +5

Hi @bela Thanks for stopping by the community! We don’t have an option to create/edit references for the answers, but @mathio or @picsoung do you happen to have any workarounds? 

Userlevel 7
Badge +5

Hello @bela I dont understand. What do you mean by “indexing” answers?

Userlevel 1

Hi Mathio,

We want to take a certain action depending on the answer selected.

To identify which of the multiple choices a person selected, we are currently doing a string match. Eg for a question on what are your hobbies, we do a string match if they select “I like adventure sports”.

We try to use natural language, so we don’t have short strings, but more conversational strings.  And it becomes complicated to scan the answers and convert each string into an identifiable index code. 

So if we reword the answer choices a bit, then maintaining the string matches becomes very difficult.  It is not a stable solutions.

If we had block references not only for questions, but also for answer options, then this would be very easy and we could consistently match on the reference codes (which I call indexes). So our code would simply look for unique references/indexes in the typeform return string.

 

Thanks,

bela

 

 

Userlevel 1

Sorry I’m probably supposed to @mathio to my previous answer.  Many thanks!

 

Userlevel 7
Badge +5

Thank you for clarification. (No need to @ me, everyone participating the thread already should receive notifications automatically.)

Each multiple choice answer should have a unique ref. I think you are unable to edit those refs, however you can use them to identify answers.

How are you retrieving answers to your typeform(s)? Are you using Responses API or Webhooks API? Each of the APIs should provide ref for the selected answer in case of multiple choice question.

If you download the CSV file from your Typeform account “Results” tab, I think that CSV does not contain refs for the answers.

Userlevel 1

Thanks so much Mathio!  Really appreciate your help. Just a quick follow-up - if I move questions around (eg move question five so it becomes question 3), will that change these unique identifiers to each answer option under that question?

 

And if I add more answer options (multiple choices) to a question, (say q 5, which is now Q3, had two options, “yes” and “no”.  And I added another option, “not sure”.  Would that mean the unique identifier for option “yes” would change? i.e. Do I lose the already existing unique identifiers?

 

Thanks, I’m trying to figure out how stable these unique identifiers for each answer type are, as I would like both stability and flexibility:)

Userlevel 7
Badge +5

You can edit refs manually, or you can keep default values. Ref value will not change if you reorder your questions. 

However if you edit multiple choice question choices you may loose your answers. There is a warning like this when you try to edit it:

 

Reply