ESRI arcade to only show fields that have a yes attribute for a clicked feature

524
2
Jump to solution
02-15-2023 05:08 PM
Labels (1)
TimWarfe_MSC
New Contributor II

Hi guys, I'm hoping someone can help me out there.

I have a feature service and when I click the map I want to use arcade to only show the fields and names as a list for the attribute being "Yes".  Leaving "No" as not displayed to tidy the popup result.

Could someone please help with the arcade to achieve this.  I've added a screenshot of the attributes and Field names as an example.

If I click on this feature I only want Black_Watt, Blackwood and Briar_Rose displayed in the popup.  Leaving the No's out.

Thanks in advance.


Tim

0 Kudos
1 Solution

Accepted Solutions
JohannesLindner
MVP Frequent Contributor

 

var yes = []
for(var field in $feature) {
    if($feature[field] == "Yes"){
        Push(yes, field)
    }
}
return Concatenate(yes, ", ")

 


Have a great day!
Johannes

View solution in original post

2 Replies
JohannesLindner
MVP Frequent Contributor

 

var yes = []
for(var field in $feature) {
    if($feature[field] == "Yes"){
        Push(yes, field)
    }
}
return Concatenate(yes, ", ")

 


Have a great day!
Johannes
TimWarfe_MSC
New Contributor II

Thank you, perfect!!!   😌

0 Kudos