Select to view content in your preferred language

Arcade expression to populate parent object ID in map viewer popup, instead of related table object ID

1031
0
01-03-2023 03:49 AM
Labels (2)
HaniehBaghbani
New Contributor

Hi, 

I have very basic knowledge of arcade and coding and I am trying to write a statement to populate the parent object ID in the map viewer popup, instead of the child (related table object ID).

My data is originally collected by survey123 and I have the hosted feature layer in ArcGIS online. I have two geotype questions in my survey form and I wanted to present them both on the map, as the result my polygon feature is the parent of the point features and they are related. Meaning my point data on the map is shown as a related data in the polygon layer table. I have managed to populate all the fields I needed from the parent layer to appear in pop up for the point (related feature) data. But the issue is about the related  feature object ID which I am using as my asset ID (in my map known as TEID). Using the Object ID seemed like the best approach to create sequential TEID number. For the polygon one I have the correct number but for the point data it won't populate the parent (polygon) object ID and it starts from number 1 and continues to a new sets of object IDs.  Although it sounds correct because the data type is different but I need both of my data type to show a sequential number as TEID. I can see that number in the table but in pop ups I couldn't manage to  populate the parent TEID and my code just returns the point object ID again or the whole features object ID column. Can someone help me to write the code, or tell me if what I am trying to do is even possible ?

 

These are my layers name and my code:

Polygon: survey

Point: Single_crane_location

Object ID: TEID

 

var related = FeatureSetByName($datastore,"survey")
var TEID = FeatureSetByName($datastore,"survey", ['objectid'])
return TEID

HaniehBaghbani_0-1672746063765.png

var related = FeatureSetByName($datastore,"survey")
var TEID = $feature["objectid"]
return TEID

HaniehBaghbani_1-1672746144434.png

Many thanks in advance.

0 Kudos
0 Replies