Hello,
I am looking for help with arcade expressions. I'm attempting to use arcade to pull and summarize data from other layers that overlap a parcel. I'm using FeatureSet and Intersects or Contains functions to do so. Unfortunately, I'm noticing some inconsistencies and I'm not sure if its the arcade expression or something else. The issue is that the expression works for most instances but appears to randomly fail for others. I've attached screenshots below as well as the arcade expression itself. Any help with resolving this issue and ensuring all points are identified correctly is appreciated. Thank you!
Screenshot of the expression working as intended. The green point represents 'Closed Activity' which is picked up by the arcade expression and correctly displayed by the Activity ID in the Parcel's pop up.
Same expression, different parcel. A buffer is included in the expression yet the expression still fails to recognize the point and populate the pop-up.
var brrts_fs = FeatureSetByName($map, "Closed Activity")
var brrts = Contains(Buffer($feature, 5), brrts_fs)
var brrts_count = Count(brrts)
var b_array = []
if(brrts_count == 0){
return {
type : 'text',
text : `<font color = "#19234A"><b>IS THERE CLOSED ACTIVITY?</b></font>` + '<br>' + `NO`
}
}
else {
for (var b in brrts){
Push(b_array, b['ACTIVITY_DETAIL_NO'])
}
var unique_b = Distinct(Sort(b_array))
var con_b = Concatenate(unique_b, ', ')
var arr = Split(con_b, ", ")
var output = []
for (var index in arr) {
var code = arr[index]
var pub = Filter(brrts_fs, "ACTIVITY_DETAIL_NO = @code")
var item = `<a href="https://apps.dnr.wi.gov/rrbotw/botw-activity-detail?crumb=2&siteId=29104100&dsn=${First(pub).DETAIL_SEQ_NO}">${code}</a>`
Push(output, item)
}
return {
type : 'text',
text : `<font color = "#19234A"><b>IS THERE CLOSED ACTIVITY?</b></font>` + '<br>' + `${Concatenate(output, " | ")}`
}
}