Advanced filter - multi constraints context

Hello everyone,

I am trying to filter a repeating group using multiple constraints. Some constraints are straightforward (i.e. x = y) and ticking “ignore empty constraints” does a perfect job at ignoring empty constraints.

However, for more complex constraints, eg. comparing two lists, I need to use the "Advanced: " option of “:filter” and this awfully complicates things. If there is one advanced constraint only it is easy, but as soon as other constraints are added, no results are showing in the repeating group unless all constraints are not empty, even when “ignore empty constraints” is ticked.

Anyone knows a solid walk-around that can easily accommodate multiple constraints (element vs. element, element vs. list and list vs. list) in a unique filter ?

Many thanks,
Thomas

7 Likes

I suggest raising a bug report.

For list vs list, you may have better luck separating into two filter expressions and joining them with merge or intersect.

3 Likes

Hi Thomas,

There are specific constraint operators that need to be used for single vs list values:

Element vs Element
Let’s say a User’s Name = Thomas and the input’s value = Thomas Jones

Name = Input’s value > would not return the record because it’s not an exact match

Name is in Input’s value > would return the record because the word “Thomas” is in the value “Thomas Jones”

Element vs List
Let’s say a User’s Name = Thomas and a custom state (list)'s value = Adam, Mary, Thomas

Name = Custom state > would not return the record because the Name field is a single value and is incompatible with a list value

Name is in Custom state > would return the record because “Thomas” is in the list “Adam, Mary, Thomas”

Advanced: Custom State contains This User’s Name > would also return the record because the state list contains the single value

List vs List
Let’s say a User’s Friends list is “Adam, Mary, Thomas” and a custom state (list)'s value = “Adam, Sam, Julie”

Friends List contains custom state list > would not return a record because it’s incompatible
Advanced: This User’s Friend’s List intersects with custom state’s value :count > 0 > would return a value if there is at least 1 overlapping item in the two lists


So, remember:
“Contains” should be used for List value contains single value or Text string contains word
“Contains list” should be used for List value contains (an entire) separate list value
“Is In” should be used for Single value is found in a list value
“Isn’t In” should be used for Single value is not found in a list value
" = " should be used for exact matches
“Intersects with” should be used to see if two list values overlap

Hope this helps clear things up!


Gaby at Coaching No Code Apps (formerly Coaching Bubble)

Courses & Products, Tutorials, Private Coaching, and High-level Development

Start Learning Today :mortar_board:

37 Likes

Thank you so much for this explanation and for your time, it helps a lot.

I still have the issue that when I leave my filter empty it doesn’t return any result in my repeating group until I input values in the input, despite the fact that I check “Ignore empty constraints”. I will try to set an invisible state that fills the filtering inputs with all possible values unless input is changed, so that my repeating group behaves the way I want, i.e. show all results at the beginning and narrow down as I apply constraints.

Thomas

1 Like

Great, you can also add a condition to the repeating group as well. “Only when input is empty > change data source to exclude the constraint all together”

1 Like

I will try that but it will be a long list of conditions with or/and, I have 6 filter inputs like this on which the repeating group’s data depends.

1 Like

To be honest, I prefer to use a different method altogether for multiple filter combinations. It involves sequencing custom workflow events so that you filter the list as an action in a specific order. It’s perfect for multiple, advanced constraints because they don’t conflict with each other. You can also do as many as you want and have each change to a filter trigger the workflow to update the list.

I have a full written tutorial on this for my VIP Members. Check it out if you’re interested!

6 Likes

My approach as well, and then finish it off with a user selected method of sorting.

2 Likes

Gaby - which tutorial covers this?

Thanks
Simon

Hi @simon, search the tutorial database for “Filtering a Search with Custom Events”

1 Like

this works for me,

But if I raise the number it is not returning a single thing, like: Advanced: This User’s Friend’s List intersects with custom state’s value :count > 1

Is this a bug?

I would assume first that you don’t have data to match that filter.

If you say count > 1, then it will return results if both lists have at least two matching items in their lists.

after reading load and loads of ideas, this nugget finally solved my problem I’ve been working on for hours. Thank you! :heart:

To add to this thread… there’s a question here about how to have the advanced filter intersect method return all results when nothing is selected. A solution is to have the filter say the following… input list’s value: count is 0 or input list’s value intersect with…"

In this example “input list” is whatever list you are comparing with the list in the datatype.

3 Likes

For anybody looking for a complete solution for advanced filtering using checkboxes here is a thread that I created when I was trying to understand how the filtering works. Maybe it helps you.

2 Likes

Hey Gaby!
Could you please explain a bit more in details? Are you creating a bunch of option sets for every filter changes?

Great post! Thanks a lot!

I’d like to ask how to put a constraint if:
“list value” is not found in another “list value”

For example:
list 1: a,b,c,d,e,f
list 2: d,e,f
result: a,b,c