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?
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.
Then add a Data View that will contain all of your data, like OBJECTID is not blank.
And go back to the dropdown menu to select your newly created Data View.
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?
If the search is connected to its own view, it shouldn't be affected by anything else going on in the application.
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.
@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.