I am trying to figure out how to sort my field called "Name" in ascending order in the arcade element expression. I wasn't able to find an HTML tag and I tried used using Order By but I couldn't get it to work. Any help would be greatly appreciated.
Thank you,
John
/*
Choose a template from the Templates tab to get started with creating different content types for your pop-up.
To learn more about using Arcade to create pop-up content visit:
https://developers.arcgis.com/arcade/guide/profiles/#popup-element
*/
var areas =FeatureSetByName($map,"Neighborhood Council Districts (Tacoma)");
var Onefifty = Buffer($Feature, -150, 'feet')
var countp = Intersects(areas,Onefifty);
var result = "";
for (var item in countp){
var name = item["Neighborhood"];
var url = item["URL"]
result += `<a href="${url}" target="_blank"><span style="color:#287fb8;"><u>${name}</a><br/>`
}
return {
type : 'text',
text : result
}
Solved! Go to Solution.
What happens when you change line 3? I'm assuming when you say "sort my field called 'Name'", you mean the 'Neighborhood' field.
var areas =FeatureSetByName($map,"Neighborhood Council Districts (Tacoma)");
var Onefifty = Buffer($Feature, -150, 'feet')
var countp = OrderBy(Intersects(areas,Onefifty), 'Neighborhood ASC');
var result = "";
for (var item in countp){
var name = item["Neighborhood"];
var url = item["URL"]
result += `<a href="${url}" target="_blank"><span style="color:#287fb8;"><u>${name}</a><br/>`
}
return {
type : 'text',
text : result
}
What happens when you change line 3? I'm assuming when you say "sort my field called 'Name'", you mean the 'Neighborhood' field.
var areas =FeatureSetByName($map,"Neighborhood Council Districts (Tacoma)");
var Onefifty = Buffer($Feature, -150, 'feet')
var countp = OrderBy(Intersects(areas,Onefifty), 'Neighborhood ASC');
var result = "";
for (var item in countp){
var name = item["Neighborhood"];
var url = item["URL"]
result += `<a href="${url}" target="_blank"><span style="color:#287fb8;"><u>${name}</a><br/>`
}
return {
type : 'text',
text : result
}