Select to view content in your preferred language

Using Arcade to pull a value from an Intersect list that is similar to already defined field?

158
0
2 weeks ago
Amarz
by
Occasional Contributor II

Hello,

I am attempting to do an Intersect from a point to a stacked polygon layer.  So far my arcade expression returns a list of values, I want to be able to isolate a single value in that list based off a predefined value when creating the point.

Data looks like:

FeatureEAMIT AssetsexampleEAMIT Facilityexample
Fieldsfacilityie: City Hall Floor 1facilitynameie: City Hall
 locationie: City Hall Floor 1 IT Officefacilityfloor

ie: Floor 1

   facilityroom

ie: IT Office

   location

ie: City Hall Floor 1 IT Office

For instance my list will return: ["City Hall Floor 2 Finance Office (261)","City Hall Basement Maintenance Shop (21)","City Hall Floor 1 Open Office (157)"]

What I want is for the arcade script to read my EAMIT Asset is assigned to City Hall Floor 1, and only return the polygon that has a similar name, so here it would reaturn City Hall Floor 1 Open Off (157) into the EAMIT Asset location field.

Here is my script.

//Here is the stacked polygon being intersected
var fs = FeatureSetByName($datastore, "DBO.EAMFacility", ["fullname","facilityname","facilityfloor","facilityroom"])
var fsIntersect = Intersects(fs, $feature)
var results = [];
for (var f in fsIntersect){
//returns all results available
  results[Count(results)] =  (f.fullname)
//what I would like here is to compare it to the established floor the Asset it on and pick the more similar EAMFacility location.
}
return results

I appreciate any assistance!

0 Replies