Select to view content in your preferred language

Values filtered by previous expressions not available for contains clause in Filter Widget?

1528
8
Jump to solution
01-03-2024 07:12 AM
Labels (1)
HaileyWright1
Regular Contributor

I'm looking for help with the filter widget, in particular filtering values by previous expressions. I’d like to set up filters on two fields that contain multiple values delimited by a semicolon. For the first filter, I’d like the user to be able to select one or more options from a list of predefined multiple values and I’d like that selection to filter the available values in the second filter. Is this capability available for contains clause with multiple predefined values? The filter widget documentation seems to imply that it should be, but I’m not seeing the option to do so in the expression builder. When I switch the clause to “is” I do see the option to filter by previous expression, but this won’t work for my field which contains multiple delimited values. Is this expected behavior?

contains.png

 

 

 

 

is.png

 

2 Solutions

Accepted Solutions
RyanBohan
Frequent Contributor

@HaileyWright1 your 100% correct, sorry for the confusion.  Please submit and idea to add "Values filtered by previous expressions." would be a great improvement for Experience Builder.

View solution in original post

TonghuiMing
Esri Regular Contributor

Hi @HaileyWright1 

The issue you had here is not specifically related to the 'contains' operator. It is related to predefined values. ('Contains' operator only supports user input & predefined as sources)

 

Given that predefined values could be manually typed in and do not have anything to do with the original data source (e.g. for domain fields, users can type in 1/2/3/... first and then update their subtype fields later), we did not include the "Values filtered by previous expressions" option - it is not the same list unique values that are dynamically populated, but rather a static list per users' choice.

 

That's the reason why you do not see that option in your case.

View solution in original post

8 Replies
BrittanyBurson
Frequent Contributor

I can't believe you posted this 9 hours ago. I am seeing the exact same problem. I have this setup so that it will only show me communities within Council District X if one is selected in the previous filter. However, it still shows me the entire list of communities from the entire city. Seems like a bug.

BrittanyBurson_0-1704326827910.png

BrittanyBurson_1-1704327401049.png

 

 

RyanBohan
Frequent Contributor

I think it needs to be in a Set.  I recall fighting with this filter functionality. 

  • Also, if you're trying to filter a map, you have to apply it to the default data view.

RyanBohan_0-1704329241270.pngRyanBohan_1-1704329252415.pngRyanBohan_2-1704329260479.png

It currently has some test data, you can view the filter results here.  Hope this helps!

0 Kudos
BrittanyBurson
Frequent Contributor

Thanks @RyanBohan you're right, it has to be a set. The language is a bit confusing. Maybe it should say "Values filtered by previous expressions within set"

TonghuiMing
Esri Regular Contributor

Hi @BrittanyBurson 

Your issue above is different from what Hailey had.

 

TonghuiMing_0-1705560568484.png

You have only one clause in the screenshot, telling me you used multiple filter items, with a single clause in each of them, like this:

TonghuiMing_2-1705561210247.png

It won't work because there is only one expression existing for each, hence no previous expressions at all. (there is only one previous filter item)

 

The "Values filtered by previous expressions" option does not necessarily need to be within a set, but all the information needs to be in one filter item (multiple clauses/clause sets inside one SQL Expression Builder) - that's the meaning of "previous expressions":

TonghuiMing_1-1705560667990.png

See two individual clauses (not inside a set) that have that option as expected.

0 Kudos
HaileyWright1
Regular Contributor

Thanks for the replies. I’m glad the clause set worked for you @BrittanyBurson. Unfortunately in my case, the issue is not that the filter by previous expression functionality isn’t working (it works fine with is (=) clauses), the issue is that I don’t even see the setting to apply it when using contains (like) clauses. I’m thinking it’s a limitation of the many to many relationship here as both of my fields that I’m trying to filter contain multiple values delimited by a semi colon. Hoping for a bug, not a table redesign 😛

Capture.PNG

TonghuiMing
Esri Regular Contributor

Hi @HaileyWright1 

The issue you had here is not specifically related to the 'contains' operator. It is related to predefined values. ('Contains' operator only supports user input & predefined as sources)

 

Given that predefined values could be manually typed in and do not have anything to do with the original data source (e.g. for domain fields, users can type in 1/2/3/... first and then update their subtype fields later), we did not include the "Values filtered by previous expressions" option - it is not the same list unique values that are dynamically populated, but rather a static list per users' choice.

 

That's the reason why you do not see that option in your case.

RyanBohan
Frequent Contributor

@HaileyWright1 your 100% correct, sorry for the confusion.  Please submit and idea to add "Values filtered by previous expressions." would be a great improvement for Experience Builder.