Select to view content in your preferred language

Search widget to search all results not filtered records based on map extent

351
5
03-06-2024 04:38 AM
Labels (1)
Tiff
by
Occasional Contributor III

In my app I have editing widgets, feature layer table, filters, and a search widget. In my search widget I want to search based on an identifier for all features in the feature layer. My table and thus the layer (default view) is set to dynamically update based on the map extent. This means that when I zoom into the map, I can only search for features that are showing in that map. How can I get the search to work independently from the filtered data and what are the best practices for setting this kind of behavior at the outset?

Tags (2)
0 Kudos
5 Replies
JeffreyThompson2
MVP Regular Contributor

This is what Data Views are for. You can set your Search Widget to a Data View with all of the features in the layer while the rest of the application is set on the Default View to handle the current interactivity.

In the Search Widget, when you select your data source use the dropdown menu and select Create a view.

JeffreyThompson2_0-1709731535057.png

Then add a Data View that will contain all of your data, like OBJECTID is not blank.

JeffreyThompson2_1-1709731700135.png

And go back to the dropdown menu to select your newly created Data View.

JeffreyThompson2_2-1709731756618.png

 

 

GIS Developer
City of Arlington, Texas
0 Kudos
Tiff
by
Occasional Contributor III

Hey @JeffreyThompson2 thanks! This is what I thought would be the solution, so I have the table set to Default view and I have a different view for the search. However, it looks like the search is still filtered to visible features on the map. I was not sure if the search has to be the default view whereas the other interactive elements had to be a different view on top of that? I also checked the map action and it is set to filter the default not the search view.

Can you advise if this is the case or the method you provided should theoretically work?

0 Kudos
JeffreyThompson2
MVP Regular Contributor

If the search is connected to its own view, it shouldn't be affected by anything else going on in the application.

GIS Developer
City of Arlington, Texas
0 Kudos
Tiff
by
Occasional Contributor III

Hi @JeffreyThompson2, thank you! On my end that does not seem to be the case. Default view filters affect all other views off of the default. Documentation on select data seems to confirm that. As soon as I switched the views (search on default, map extent to update a different view), it worked. Still some wonky behavior where filters on map have to be for the default or it doesn't filter the map appropriately. But this issue above seems to be fixed.

JeffreyThompson2
MVP Regular Contributor

@Tiff Good to know. I've never really encountered a situation where a Data View would be useful, so I guess I got it backwards.

GIS Developer
City of Arlington, Texas
0 Kudos