Strict Search using Query Param | Community
Skip to main content
Answered

Strict Search using Query Param


Forum|alt.badge.img

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?

Best answer by picsoung

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.

View original

Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • May 16, 2022

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


mathio-tf
Typeform
Forum|alt.badge.img+5

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


picsoung
Typeform
Forum|alt.badge.img+5
  • Developer Advocate @ Typeform
  • May 17, 2022

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