Arcade expression - getting Object ID from another table by the common attribute

1495
1
Jump to solution
05-04-2020 02:58 PM
KerryKang
Occasional Contributor III

Hello all, 

I hope to find way to retrieve the original object ID of the joined layer(a view layer) through Arcade.

 

 

Layer 2 is a joined view layer from Layer 1 and Table 1. I need to call the original object ID (Layer 1) inside of Layer 2 in order to pass urls that are created by some sort of combination of the original object IDs.

For example there are 5 records in Layer 1 from object id 1 to 5. But by joining, Layer 2 became to have 10 rows, and the original object IDs are not preserved in the same way.

 

I was thinking about retrieving the original object ID from Layer 1 by using the common attribute called track ID. Tow layers (Layer 1 and 2 are added in the map).

newValue = Layer1.OID where Layer1.TrackID == Layer2.TrackID

Is it possible to write Arcade like above? I've been using python mostly so not super familiar with Arcade yet.

Here are some challenges -  these are dynamic layer - new records are kept added by survey123, so the filed cannot be pre-calcuated by adding a new column. I should be able to extract the original ID on the fly. 

Cheers,

K

1 Solution

Accepted Solutions
KerryKang
Occasional Contributor III

I could figure it out

var lookup = $feature.trackID

var temp = FeatureSetByName($map,"map_name")

var newValue = Filter(temp,  'trackID = @lookup')

return Text(newValue.objectid)

Cheers,

K

View solution in original post

0 Kudos
1 Reply
KerryKang
Occasional Contributor III

I could figure it out

var lookup = $feature.trackID

var temp = FeatureSetByName($map,"map_name")

var newValue = Filter(temp,  'trackID = @lookup')

return Text(newValue.objectid)

Cheers,

K

0 Kudos