New Map Viewer - Configure POP UP Expressions

383
1
Jump to solution
03-11-2022 12:16 PM
by Anonymous User
Not applicable

Hello,

@jcarlson - so close.  This arcade expression works great. Thank you very much. However, I have tried several ways to change the return to only display the number of complaints, but I cannot figure it out.  This is what the current return looks like:  

AnnettePoole1_0-1647029380034.png

Since I already have "TotalComplaints"  I do not need "total" just the "3".  In my various attempts, I either displayed nothing at all or just the word total.  But all I want is the number.  I tried to manipulate the "total: total" in the return section. I also attempted to delete the "total" in the for loop. No luck as I don't understand it that well obviously.  Thank you!

var sum_fields = [
$feature.complaint,
$feature.complaint1,
$feature.complaint2,
$feature.complaint3,
$feature.complaint4,
$feature.complaint5,
$feature.complaint6,
$feature.complaint7,
$feature.complaint8,
$feature.complaint9,
$feature.complaint10
]

var total = 0

for (var s in sum_fields){
If (!IsEmpty(sum_fields[s])){
total += 1
}
}

return {
 total: total

}

0 Kudos
1 Solution

Accepted Solutions
jcarlson
MVP Esteemed Contributor

If this is just in a popup, can you simply do

return total

instead?

- Josh Carlson
Kendall County GIS

View solution in original post

0 Kudos
1 Reply
jcarlson
MVP Esteemed Contributor

If this is just in a popup, can you simply do

return total

instead?

- Josh Carlson
Kendall County GIS
0 Kudos