I wrote an Arcade expression to calculate the zip code of an address point from its intersecting zip code polygon, and it works just fine:
var fsZip = FeatureSetByName($datastore, "ZipCodes", ["Zip_Code"])
var fsZipIntersect = Intersects(fsZip, $feature)
var zip = First(fsZipIntersect)
return zip.Zip_Code
I use a similar expression to calculate the municipality from the zip codes feature class with no problems:
var fsZip = FeatureSetByName($datastore, "ZipCodes", ["PO_NAME"])
var fsZipIntersect = Intersects(fsZip, $feature)
var city = First(fsZipIntersect)
return city.PO_NAME
But when I try to do essentially the same process to calculate the intersecting neighborhood or building footprint I get an error, "Dictionary Type Expected".
var fsBuilding = FeatureSetByName($datastore, "BuildingFootprint", ["bldngid"]
var fsBuildingIntersect = Intersects(fsBuilding, $feature)
var Building = First(fsBuildingIntersect)
return Building.bldngid
var fsNeighborhood = FeatureSetByName($datastore, "Neighborhood", ["nbrhdid"])
var fsNeighborhoodIntersect = Intersects(fsNeighborhood, $feature)
var Neighborhood = First(fsNeighborhoodIntersect)
return Neighborhood.nbrhdid
All of my feature classes are in the same file geodatabase that I'm using for testing, so they're all in the same data store. Does anyone know why this might be happening?