Create a Filter That Hides Everything Until The User Searches For Something (Also hide stuff that the user can never see)

1123
3
10-24-2023 07:51 AM
JeffreyThompson2
MVP Frequent Contributor
5 3 1,123

This guide is copied from a post by @TonghuiMinghttps://community.esri.com/t5/arcgis-experience-builder-questions/overwrite-default-map-filter/m-p/1...

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":

JeffreyThompson2_0-1698158532795.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:

JeffreyThompson2_1-1698158532854.png

Additional Tip: If you want to hide something in a feature layer completely from the user, you can set a filter in your webmap. Users in this example will never see a park that without the DevelopmentClass of Developed.

JeffreyThompson2_2-1698159045280.png

 

 

3 Comments
SarahRijneke
Frequent Contributor

I like this approach but I would like the user to be able to select data to turn on using a location name. If they misspell it it won't appear on the map. Would it be possible for them to select the location from a list of values?

JeffreyThompson2
MVP Frequent Contributor

@SarahRijneke I believe that second configuration would allow you to use a dropdown menu or buttons. Right, @TonghuiMing?

SarahRijneke
Frequent Contributor

I have it working now 🙂

SarahRijneke_0-1765466270854.png

SarahRijneke_1-1765466291802.png

 

Contributors
About the Author
A frequently confused rock-hound that writes ugly, but usually functional code.