Select to view content in your preferred language

Search using &find= with a web map URL only searches top layer

2445
3
Jump to solution
02-14-2018 12:02 PM
AaronKoelker
Occasional Contributor III

Trying to integrate an AGO web map into a custom application that would search for specific features in the map using the map URL + "&find=EXAMPLE_FEATURE_HERE". In the web map settings I've enabled "Search by Layer" and added two layers that I need to be searchable. This method works fine if I only need to search one layer, however with two I've noticed in the browser developers console that only the first layer is being queried. If the feature I'm searching for is in the second search layer, I get a "No Results found". If I remove the first layer or swap the order, I'll get search the new "top" layer, but not the other. See web map settings image below. 

If I use the built in search box in the web map, everything works as intended. So I'm curious why this doesn't work the same way with the URL. Is this a bug?

The below screen shows the browser dev console. The data is a standard ArcGIS Server web service. You can see it only does one search query, for whichever layer is first. Here, I'm searching for something in feature 0, and moved feature 1 to the top in the web settings (PWS Plants in image above).

-Aaron
Tags (4)
0 Kudos
1 Solution

Accepted Solutions
KellyGerrow
Esri Frequent Contributor

Hey Aaron,

Try using the feature search  parameters outlined in this documentation when searching for features in more than one layer:

Use URL parameters to modify embedded maps—ArcGIS Online Help | ArcGIS 

-Kelly

View solution in original post

3 Replies
KellyGerrow
Esri Frequent Contributor

Hey Aaron,

Try using the feature search  parameters outlined in this documentation when searching for features in more than one layer:

Use URL parameters to modify embedded maps—ArcGIS Online Help | ArcGIS 

-Kelly

AaronKoelker
Occasional Contributor III

Thanks Kelly, I'm not sure how I didn't come across that already. It looks like that should work!

-Aaron
0 Kudos
PaulLohr
Regular Contributor

Aaron, that is excellent detective work. This helped me quite a bit.

Kelly, thanks for the link to AGOL feature search documentation. It would be helpful if the documentation explained how to find the layer name and column name. Without that, I'm using AGO Assistant and guessing.