Forum Documentation Showcase Pricing Learn more

Advanced filter - multi constraints context


#1

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


#2

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

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:


#4

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


#5

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”


#6

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.


#7

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!


#8

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