Agol Overlapping Features in Pop-Up (Arcade)

264
2
Jump to solution
08-13-2020 11:49 AM
aam
by
New Contributor III

Hi Guys need help with the Arcade expression. I got the expression working to get all the zones within a given parcel. I added a comma to for multiple zones within a parcel. However a comma also shows up at the end. How can I fix this expression so there is no comma at the end.

var intersectLayer =Intersects(FeatureSetByName($map,"Zones"),Buffer($feature, -10, 'feet'))

var zones = ""

for (var f in intersectLayer){

zones = Concatenate(zones, f.BASEZONE, ", ")

}

return zones

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
XanderBakker
Esri Esteemed Contributor

Hi aa.malik ,

One way of doing this is to create a list with all the values and at the end apply the concatenate  to that list:

var intersectLayer = Intersects(FeatureSetByName($map,"Zones"),Buffer($feature, -10, 'feet'));
var zones = "";
var lst = [];
for (var f in intersectLayer){
    lst[Count(lst)] = f.BASEZONE;
}
zones = Concatenate(lst, ", ");
return zones;

View solution in original post

2 Replies
XanderBakker
Esri Esteemed Contributor

Hi aa.malik ,

One way of doing this is to create a list with all the values and at the end apply the concatenate  to that list:

var intersectLayer = Intersects(FeatureSetByName($map,"Zones"),Buffer($feature, -10, 'feet'));
var zones = "";
var lst = [];
for (var f in intersectLayer){
    lst[Count(lst)] = f.BASEZONE;
}
zones = Concatenate(lst, ", ");
return zones;
aam
by
New Contributor III

This is really great. Thank you!!