Arcade Expression will not display in Pop-up in new Map Viewer

1414
3
Jump to solution
02-03-2022 11:23 AM
Labels (2)
WingCheung1
New Contributor II

Hello all,

I am pretty new to the new Map Viewer, so maybe I just missed a step.

I am customizing the pop-up in the new Map Viewer using Arcade. The expression works when I hit Test, but the Pop-up in the new Map Viewer only briefly display a spinning circle and doesn't display the message created by the expression. I have tried re-doing it, restarting the map viewer, but it doesn't work. When I put the same expression in the classic Map Viewer, it immediately works. Any ideas? Any assistance is greatly appreciated. 

Here is the expression:

var LocCodes = {
"incorp":"incorporated city",
"unincorp":"unincorporated community"
}

var Loc = $feature.loctype
var LocDesc = LocCodes[Loc]
var SumCases = sum($layer, "confirmedcases")
var FilterCases = sum(Filter($layer,"loctype=@Loc"),"confirmedcases")
Return Proper($feature.name) + " is an " + LocDesc + " located in San Diego County. It recorded " + $feature.confirmedcases + " COVID cases as of Jan, 25, 2022. This represents " + Round($feature.confirmedcases/FilterCases*100,2) + "% of the total cases recorded in all of the " + LocDesc + " jurisdiction, and " + Round($feature.confirmedcases/SumCases*100,2) + "% of the total cases recorded for the entire county."

Tested fine for the new viewerTested fine for the new viewer

Expression tested fine in the new and classic viewer

Arcade expression doesn't show in new viewer's pop-upArcade expression doesn't show in new viewer's pop-up

New viewer pop-up fails to update with the message from the expression

worksinclassic.jpg

 Classic viewer pop-up updates with the message from the expression

0 Kudos
1 Solution

Accepted Solutions
ABishop
MVP Regular Contributor

Hello Wing,

I think you have to do one extra step and add the expression field in as a "field" to you pop-up in the New Viewer.

Amanda Bishop, GISP

View solution in original post

0 Kudos
3 Replies
ABishop
MVP Regular Contributor

Hello Wing,

I think you have to do one extra step and add the expression field in as a "field" to you pop-up in the New Viewer.

Amanda Bishop, GISP
0 Kudos
WingCheung1
New Contributor II

Thank you Amada. I figured out what I was doing wrong. I added my Arcade Expression using the +Add content icon instead of Manage Expression. Once I went through Manage Expression and added my expression there, I was able to see my expression in the Fields list and include it in my pop-up. Thanks!  

ryanEvanczyk
Occasional Contributor

This is exactly what I was doing wrong....thank you.