Overwrite Default Map Filter

1215
3
Jump to solution
03-17-2023 01:09 PM
Labels (1)
MattChomicky1
New Contributor III

I have a specific map, layer, and filter configuration setup in Web AppBuilder that is used for a lot of web apps in my organization that I am having trouble working out how to implement in Experience Builder.

The setup is for side-by-side charting of data from specified location IDs in a web map layer. Essentially I have a feature service layer set up where I have joined a bunch of related table data to the base location points to compile all the data into one table, so for each location ID, I have multiple duplicate points for each combination of related data. I have these set up with an attribute called "list_index" where a value of 0 is the "parent" record with no values in the columns that are joined in from the related tables, and values of 1,2,3, etc. represent records with related table info.

In my web map, I have visible by default in the map one copy of this layer with the default filter of "list_index = 0" to display the single parent point for each location, and I have multiple copies of this layer that I use to add a halo underneath/around the parent points and to populate the charts when the user selects a location ID. The copies of the layer have the default filter of "list_index = -1" to ensure that these points don't show up on the map and that the charts are empty until after a user specifies a location ID. Default view when loading the app:

MattChomicky1_1-1679083325428.png

View after selecting location IDs and other parameter for the copy layers:

MattChomicky1_3-1679083459900.png

 

This is possible in Web AppBuilder because of the "Remove the preset layer filter from the map" option in the Filter widget:

MattChomicky1_4-1679083530423.png

 

I can not find a similar option in Experience Builder. I have tried removing the default filters from the web map itself and changing it to be a default filter within the dataset in Experience Builder, creating a separate Data view with the default filter applied, etc. but haven't had any luck getting this to work so far.

Any way possible to do this?

1 Solution

Accepted Solutions
TonghuiMing
Esri Regular Contributor

Hi @MattChomicky1 - I could think of a simple solution, but the usage level might be limited depending on your SQL complexity.

 

The first option is that you can configure a filter widget with clauses like the following - one clause with a solid none case, like ("OBJECTID=-1"), and not ask for values; then add other clauses that ask for values (they must not contain preset values, being all empty to make it work). Remember to set the logic operator to "OR":

TonghuiMing_0-1683711261729.png

Last but not least, you need to turn on the option "Apply this filter automatically". In this way, you will have the following behavior which starts with none on the map and filter by the desired/input values:

 

The second is pretty much the same but could be a little more straightforward - add a single filter item to do the above configurations, with only that special clause & turned on automatically. In other filter items, add the criteria for your cases. You can use OR/AND depending on how you want your users to experience:

TonghuiMing_1-1683711758849.png

 

Hope it could be helpful somehow for your app.

View solution in original post

3 Replies
TonghuiMing
Esri Regular Contributor

Hi @MattChomicky1 - I could think of a simple solution, but the usage level might be limited depending on your SQL complexity.

 

The first option is that you can configure a filter widget with clauses like the following - one clause with a solid none case, like ("OBJECTID=-1"), and not ask for values; then add other clauses that ask for values (they must not contain preset values, being all empty to make it work). Remember to set the logic operator to "OR":

TonghuiMing_0-1683711261729.png

Last but not least, you need to turn on the option "Apply this filter automatically". In this way, you will have the following behavior which starts with none on the map and filter by the desired/input values:

 

The second is pretty much the same but could be a little more straightforward - add a single filter item to do the above configurations, with only that special clause & turned on automatically. In other filter items, add the criteria for your cases. You can use OR/AND depending on how you want your users to experience:

TonghuiMing_1-1683711758849.png

 

Hope it could be helpful somehow for your app.

AnnaChang
New Contributor

Hello Tonghui, this is really helpful when the filter is not been nested in widget controller. In my case, we have multiple filters, so from the overall appearance purpose, we have to use widget controller, and then the auto-apply doesn't work for us. Do you have any suggestions based on this?

AnnaChang_0-1702937733316.png

 

0 Kudos
LindsayKindle
New Contributor II

Hi @TonghuiMing,

Thank you for this solution - this was really insightful and helpful!

I created a button to toggle the visibility of a layer and it works as expected, but because the "on" state of the filter hides the layer and formats the button to appear "active", it's confusing visually.

LindsayKindle_0-1703173850388.png

Is there a way to change the styling of the button with Experience Builder? Or do you need the developer edition to make this change?

 

Thank you!

0 Kudos