Select to view content in your preferred language

Accessing field value from other in Arcade (Zone Lookup

159
2
Jump to solution
12-02-2024 06:01 AM
Labels (1)
ZekeMI
by
Frequent Contributor

Good morning,

I'm using the Zone Lookup Instant App to retrieve field values from several layers in a popup. I'm having a problem retrieving the field value in layers other than the main one. I can get other feature sets, but since they're feature sets, I get the OBJECTID as well.

What I want is just the value of the field, not the whole feature set. How can I access that? Thanks!

    // This works in returning a feature set consisting of OBJECTID and Label, e.g.
    // OBJECTID: 10 Label: 'Smith County', but all I want is 'Smith County'

    var filt_county = Intersects(center, FeatureSetByName($map, "Counties", ['Label'], false))
1 Solution

Accepted Solutions
jcarlson
MVP Esteemed Contributor

Once you get the FeatureSet, accessing specific attributes is going to require either a loop, or a function that pulls out a single feature.

var filt_county = Intersects(center, FeatureSetByName($map, "Counties", ['Label'], false))

// check if there are any counties; grab label of first, or fallback text if none
return Iif(
  Count(filt_county) > 0,
  First(filt_county)['Label'],
  'No Intersecting County Found'
)
- Josh Carlson
Kendall County GIS

View solution in original post

2 Replies
jcarlson
MVP Esteemed Contributor

Once you get the FeatureSet, accessing specific attributes is going to require either a loop, or a function that pulls out a single feature.

var filt_county = Intersects(center, FeatureSetByName($map, "Counties", ['Label'], false))

// check if there are any counties; grab label of first, or fallback text if none
return Iif(
  Count(filt_county) > 0,
  First(filt_county)['Label'],
  'No Intersecting County Found'
)
- Josh Carlson
Kendall County GIS
ZekeMI
by
Frequent Contributor

Thanks @jcarlson! I'd tried a variety of ways to get at the field. Closest to correct was 
First(filt_county['Label']

0 Kudos