Select to view content in your preferred language

Is there a way to make an arcgis online searchable on a field in a related record?

1477
11
11-17-2023 11:38 AM
Labels (2)
MDB_GIS
Frequent Contributor

I have a map that was published with a related table. That related table contains an ID that I would like to be searchable in ArcGIS online. When that ID is searched for, I'd like for it to pull up the feature that is related to it. Is that possible?

I currently have the table enabled to be searched in the layer itself, but when you pull it up, and try and zoom to it, nothing happens. 

0 Kudos
11 Replies
clt_cabq
Frequent Contributor

I want to make sure I understand what you are wanting here. You have a feature layer and it was published with a table (non-spatial) that relates to the feature layer. I'm assuming two things here: First, the the ID you mention is the field that relates the two objects (feature layer and related table) and second that there is a 1:M (one to many) relationship involved where the related table can have multiple records that match by the ID to the feature layer. Is this correct? 

Normally in this case, especially in AGOL users will search for a given spatial feature and then find all the related records in the non-spatial table. Is this how you see your end users working? Or is there some reason why they would be looking at the related table first in order to find the spatial feature?  Having a clear idea how you imagine or want your end users to interact with the map can be important.

Lastly, how was the feature and related table published? Was it published to AGOL as a hosted feature layer from ArcGIS Pro? Or is it a service published by ArcGIS Enterprise (or ArcGIS Server) to create a feature service that has been registered with AGOL? This is important because AGOL deals with relationships in these instances differently.

0 Kudos
MDB_GIS
Frequent Contributor

You are correct on both counts. The tables are related by a GUID and have a 1:M relationship. 

In an ideal world for me, I would be able to type in the attribute I am searching for (in this instance it is a case number from the related table), and it would find the record that contained it and zoom to the feature that is related to that record. The primary feature is a parcel in this use and the related records are zoning cases, of which there can be many. That's why my ideal process starts with the related table. In many cases, the end user (our planning department) will know case number off hand before they will know anything about the parcel. So I'd like for them to be able to use the case number from the related table to search for the record. 

I published it as a hosted feature layer from ArcGIS Pro. 

 

0 Kudos
clt_cabq
Frequent Contributor

Since you published your feature layer and table from Pro as a hosted feature service I think this is simpler than otherwise. I think this help item will guide you on how to do this, you essentially are looking at configuring your popup to show the related records to a selected feature on the map:

Related Records in Pop-up

Because you want to have users search the map you are probably going to have to create a web app to allow this - depending on your needs one of the simple instant apps would probably work well. But in your web map go to settings in the detail page and scroll to the bottom and set how you want the map to perform searches, in the screen shot below have set up the web map to allow searching against a city council district layer using the councilor name and the 'contains' parameter so that users can enter partial names and get a pick list of potential matches.

clt_cabq_0-1700255660306.png

 

0 Kudos
MDB_GIS
Frequent Contributor

I've actually already done that part. If I search for the record in the map, it finds it the record in the related table but will not zoom to the feature (even though it has the option to do so). Here is a video of me attempting that process. 

RelatedRecorodAGOL.gif

0 Kudos
clt_cabq
Frequent Contributor

Huh, that's a little weird. Is the point you are looking for in the extent shown already? Here's an article that talks about changing some settings that impact how much you can zoom in, not sure this is what your issue is here though:

problem-unable-to-zoom-in-on-web-maps 

Hope you can find a solution!

 

0 Kudos
MDB_GIS
Frequent Contributor

It is not. It doesn't matter where I pan to, it just won't zoom to that feature of the related record. I wasn't sure if it was intended to or not. I guess a call to ESRI is in order next week. 

0 Kudos
ChristopherCounsell
MVP Regular Contributor

You can't zoom to non-spatial records.

The search results will show the table record pop-up.

You can add 'related records' to the table layer pop-up. Clicking into this will show the parent feature with geometry and a 'select' button. In Map Viewer that will pan you to the feature with it selected.

What are your users doing? If they're on Field Maps, this is as good as it may get. There should be an idea/ENH request for improving this.

If they're accessing via the web browser, set them up with Experience Builder or another application. These support actions/triggers. So you could search for a record in a table which then applies the filter/selection to the map based on globalid/parentglobalid filters. It's generally better to build a web app for end users over sharing the web map itself. 

0 Kudos
gis_KIWI4
Frequent Contributor

Hi @MDB_GIS - You could achieve this (with a horrible workaround) within ArcGIS ExB Application. 
In the Search Widget settings you define a framework to select related records.

In the screenshot below - Vegetation is point feature layer and Hazard is a table related by a relationship class.

gis_KIWI4_0-1700444929186.png

I can search for a Hazard, I can see it and selecting the table record selects the feature layer record. 
gis_KIWI4_2-1700446669179.png

You then click on the 'magnifying' glass to zoom to the record. 

gis_KIWI4_3-1700446767974.png

 

 

0 Kudos
MDB_GIS
Frequent Contributor

Thank you for this post, this is pretty much what I'm looking for. I think I have replicated your steps, however, and the "Selected Features" button does not show up for me. Have I missed something? 

MatthewBeal_0-1700575743413.png

The search widget auto-populates, so it sees the table, but for some reason, the option to select just doesn't appear. 

0 Kudos