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'
Solved! Go to Solution.
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'
)
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'
)
Thanks @jcarlson! I'd tried a variety of ways to get at the field. Closest to correct was
First(filt_county['Label']