Using ArcGIS Pro 3.3.1
Could someone tell me what is wrong with the expression, please. I am trying to use contains or possibly use intersects to bring back the zip in an attribute field when an address is being added in the database. The zip boundaries are on the sde. and I am wanting it to recognize the ZIP field in that data.
Error I am getting
Solved! Go to Solution.
Using ArcGIS Pro attribute rules you can do this rather easily - see an example here - Solved: Using Attribute Rules to calculate fields from int... - Esri Community
Quite a few things, really.
There are other issues as well, but honestly, just throw that whole expression out. To intersect with another layer, you need to get the other layer as a FeatureSet, and you also need to reference an individual feature for the intersection.
It might look something like this:
// zip polygons
var zips = FeatureSetByName($datastore, 'ZIP_CODE_BOUNDARIES', ['ZIP'], true)
// intersect
var xs_zips = Intersects($feature, zips)
// grab the first intersected feature
var the_zip = First(xs_zips)
// return the zip of that feature
return the_zip['ZIP']
Using ArcGIS Pro attribute rules you can do this rather easily - see an example here - Solved: Using Attribute Rules to calculate fields from int... - Esri Community
Thank you for sending me to the helpful information.
I was able to get it to work using the below expression.