Forum Academy Marketplace Showcase Pricing Features

Searching a list of texts using OR logic

I have a text field called region. I am trying to create a filter that allows me to search the database for the region values using OR logic (i.e., return any entries with Asia or Caribbean).

I’m using contains to constrain the search but it will not recognize multiple entries. It only works when I select one region. If I select more than one, the list simply will not display.

How can I correct this?

Thank you.

Try “Region is in” in your constraint or “Do a search for” and then “merge” the search with one or multiple “Do a search for” where the you apply different contraints to each one of those.

merge

The second option doesn’t work because the values I’m filtering are in the same field.

It seems like the first option of using the ‘is in’ would work, but instead, it seems to ignore my selections and returns all entries in the database, even if I only select one region.

Here’s a screenshot of what it looks like. The user selects one or more regions and stores the values in a state field (filter_region_list). The desire is to display all entries where the Region field equals one of the values stored in the temporary state (filter_region_list)

region

Beware of “Ignore empty constraints”. It returns all rows if no filter is set.

I set up an example app for you. Hope this helps you out!

Thank you for this. I was able to do what I needed.