Answered

Strict Search using Query Param


Badge

According to the documentation, the query parameter fetches all responses whether matching the string in full or part. My scenario is a bit different, I want responses only to be returned if and only if the entire string is matched and that too if they are an answer to a specific field (I’m ok with using the fields param to specify the field id).

Is there a way I can achieve this?

icon

Best answer by picsoung 18 May 2022, 00:01

View original

3 replies

Userlevel 7
Badge +5

@mathio do you happen to know if this is possible? 😯

Userlevel 7
Badge +5

@Liz sorry I dont know, I havent tested this.

Userlevel 7
Badge +5

Hey @Abdullah 

I imagine you are referring to our Responses API is that right?
 

using a combination of query and answered_fields you should be able to achieve what you are looking for.

example
https://api.typeform.com/forms/{form_id}/responses?query={text_to_search}&answered_fields={field_id}

We will look for the text_to_search in the fields specified. So if they appear somewhere else, they will be ignored.

We do partial matching, so if you search for pedropedro@lol.com and pedro is my friend would both match.

Hope it makes sense

@Liz I think we should move this discussion to the developer forum.

Reply