Using regex for string-type filters
Introduction
When adding filters for a string-type field, there may be times when standard operators can't achieve what you need. For example, when defining multiple filter conditions, the default condition is AND - so ALL specified filters must be met for a match. But what if you need an OR condition?
For more complex filtering requirements, regex can be used.
Regex filter example
Let's take the following payload:
Suppose we want to retrieve any items where the value of the fruit
field contains peaches
OR apples
. We might be tempted to add two string-type filters in the filter shape:
However, this wouldn't return any matches because we'd be looking for any records where peaches
AND apples
are present. Instead, we can define one string-type filter with regex:
Last updated