Select to view content in your preferred language

Can we make a multi field search or a filter?

1306
10
01-31-2020 12:22 PM
deleted-user-aT9BCrgkP4kc
Deactivated User

Trying to figure out how to build a multi field search or filter that will work on the viewer template, is it possible or do I need to get out of the viewer template and have it facing one solo reference map?#appstudio 4.1

Tags (1)
0 Kudos
10 Replies
ErwinSoekianto
Esri Alum

Cody, 

It is possible to do it in both inside Map Viewer template, I would recommend re-purposing or copying the current search places panel that we already have, and then add another input text fields as needed. The source for this panel is MapViewer/views/SearchPage.qml. 

Thank you,

Erwin

0 Kudos
deleted-user-aT9BCrgkP4kc
Deactivated User

Is it possible to do it based on a feature? Thank you

0 Kudos
ErwinSoekianto
Esri Alum

Yes, and in this case, this could be supported out of the box in the Map Viewer template. First, you need to enable the search to layer in the WebMap setting in ArcGIS Online, then you can specify which field(s) you want the search based on. Then, a new tab will appear in the Search Panel, Feature search, in Map Viewer template (based on AppStudio 4.1) of the webmap. 

Thank you,

Erwin

0 Kudos
deleted-user-aT9BCrgkP4kc
Deactivated User

I followed the steps exactly and it will allow me to search on one, but not both fields under the same feature at once example: If I want to search a pole number, I'd need to search town and pole number to find it, we could have 100's if not 1000s of poles with the same number in different towns. Right now it's allow me to search on one of the fields at a time not both, is it possible to search on both at the same time/or is this there a way to make a filter to do this?

Happy Friday!

0 Kudos
ErwinSoekianto
Esri Alum

How about only show results of the search for features that are within the extent of the map? 

We can add another parameter to the Query Parameter, which is the "geometry", that we can add the extent of the map. QueryParameters QML Type | ArcGIS for Developers 

The customization for that can be done in the MapViewer/views/SearchPage.qml, inside function queryServiceTable(). 

0 Kudos
deleted-user-aT9BCrgkP4kc
Deactivated User

That would be useful for our field users, however with a lot of our users they are away from a work station, only having a mobile device but not in that area. With collector before we used to have the search functionality to a long list of records, now that's limited to ten. For us moving forward we would like to have preferably a search that is one feature using two fields or a filter. Is there that capability?

0 Kudos
ErwinSoekianto
Esri Alum

I see, it looks like it is not available in the out of the box Map Viewer template, as of today AppStudio 4.1. I would recommend re-purposing or copying the current search places panel that we already have, and then add another input text fields as needed. The source for this panel is MapViewer/views/SearchPage.qml. 

If you would like to have this added in out of the box Map Viewer template, I would recommend submitting an official  enhancement request with Esri Technical Support

deleted-user-aT9BCrgkP4kc
Deactivated User

Thank you!

0 Kudos
deleted-user-aT9BCrgkP4kc
Deactivated User

I'm in the searchpage.qml, confused though, which lines should I copy (from the template) to produce a second search by text field? 

0 Kudos