How to copy attributes from closer polyline feature to a point feature distance 200ft apart

03-30-2021 09:59 AM
Labels (1)
New Contributor II

This is my expression so far

I am getting an Invalid error( *Unexpected Null) 

var fsroad = FeatureSetByName($datastore, 'RoadCenterline', ['PRD'])

var intersectRoad =(Intersects(fsroad, Buffer($feature, 200, 'feet')))

var prd = First(intersectRoad)

*if (prd == null) return prd.PRD

Tags (2)
4 Replies
MVP Esteemed Contributor

You could use Near (Analysis) (Python Script at the end of the page, if required)

Define a Search Radius of 200 ft.

Keep the desired attributes under Field Name Property.

Think Location
0 Kudos
New Contributor II

My goal is to migrate the Attribute Assistant(Desktop)we have in place to Attribute Rules(ArcPro). 

0 Kudos
New Contributor II

I am also working on migrating to attribute rules and learning arcade. You have to properly filter out the nulls. I do not fully understand but will post some code that someone helped me with that solved the same or a similar problem. The top portion of your code looks good (I think) but you need to do more for potential null returns. I dont know your fields and attributes but this code and description may help you get around your unexpected null issue. Thanks to the ESRI community for helping me with this!

var feature_field = $feature.LOCDESC;


var address = featuresetbyname($datastore, 'situs');

//sets the variable ‘address’ to be pulled from the situs layer//


var closest_address = first(intersects( address, Buffer($feature, 500, 'feet')));

// this is the meat and potatoes of the operation – pulls the first intersecting situs point within 500 feet//


if (closest_address == null)


return $feature.locdesc;


if (isempty(closest_address.street_name))


return $feature[feature_field];


//takes care of the null values//


return closest_address.street_no + " " + closest_address.street_pre_dir + " " + closest_address.street_name + " " + closest_address.street_suffix + " " + closest_address.street_post_dir + " " + closest_address.zip_city + " " + closest_address.zip_code

//concatenates address data to LOCDESC field //

0 Kudos
New Contributor II
Thanks :)

0 Kudos