Select to view content in your preferred language

Fetch an attribute from underlying data layer in Field Maps

179
2
08-14-2024 10:14 AM
AshlieHildebrand
Emerging Contributor

I am trying to auto populate an attribute field in a layer in Field Maps forms using Arcade. I am placing a point on top of an existing point in Field Maps and I want to auto populate a field from the existing point layer to the feature I just created on top of it. I am using snapping, so they should be exact.  I am using the following calculation in forms and it will return "Null" but not the attribute from the underlying layer, which is what I want.

What am I doing wrong.....I used the code from the "Common calculated expressions for ArcGIS Field Maps" document.

0 Kudos
2 Replies
KeizzyA
Emerging Contributor

There could be a number of things but I would like to rule something out.

The second line what if you wrote it like this:

var SiteID = First(Intersects($feature, SiteIDs))

Hope it was that simple!
0 Kudos
AshlieHildebrand
Emerging Contributor
Nope that didn't make a difference...
 
Update:
 
The below code works for a polygon feature that is the underlying feature but it gives me "No Data" for a point feature and I am using snapping. Thoughts....
 
var SiteIDs = FeatureSetByName($map,'Polygon Test',['SiteID'])

var SiteID = First(Intersects($feature, SiteIDs))

if (!IsEmpty(SiteID)) {
  return SiteID['SiteID']  
} else {
  return "No Data"
}
0 Kudos