Queries in Typeform Responses API | Community
Skip to main content
Answered

Queries in Typeform Responses API

  • June 3, 2022
  • 1 reply
  • 308 views

  • Explorer
  • 2 replies

Hello, 

I’m currently using Typeform’s Response API on bubble.io, which identifies users in the quizzes via a unique id hidden field generated and sent by bubble. And I need to build a system that overwrites previous answers and considers only the last submission by said user”s unique id hidden field

1 - I’ve “grouped by user unique ids” the responses body items and told the algorithim to count the number of elements in these groups. And then return me the unique id values of grouping whose element count is > 1. This returns me the IDs of users that have replied more than once in a comma separated string

 

This returns me the value of 1647364753931x592178017281694800, 1647365383886x456009259892985900 which is the expected result in my test database (these two users are the only ones to have answered more than once)

2 - This is where it gets HAIRY. I need to make another request for the API only with these two user id values which would return me responses given by user A OR user B (and any other comma separated users who might take the quiz a second time), but If I input these values in the query field it’ll look for users who have BOTH unique id A and B, not A OR B.

 

If I enter just one of the two IDs the query works as intended, so, I need to get this one step of querying for multiple values figured out to complete this system.

 

Can anyone help me? Thanks in advance

Best answer by picsoung

Hi @Jeta 

That’s an interesting use case!

I was wondering if it would not be easier to use webhooks, receive typeform responses as they come and store them in your database at this moment.

What do you think?

On Responses API, the query parameter performs a full text search, and it does not support any operand to run complex queries like the one you envision. So you probably would have to make a request per id.
 

View original

1 reply

picsoung
Typeform
Forum|alt.badge.img+5
  • Developer Advocate @ Typeform
  • 391 replies
  • Answer
  • June 4, 2022

Hi @Jeta 

That’s an interesting use case!

I was wondering if it would not be easier to use webhooks, receive typeform responses as they come and store them in your database at this moment.

What do you think?

On Responses API, the query parameter performs a full text search, and it does not support any operand to run complex queries like the one you envision. So you probably would have to make a request per id.
 


Reply