Hi there, Not sure the best place to post this. Just need a fresh set of eyes. Still new to Arcade and want to get a calculated expression going in my form in MapViewer.
Have I set this up right? I'm not getting an output.
var A = $feature.A
var B = $feature["B_B"]
var PA_EF = When(
A=='010417192124' && B == 'Pre2000s', 2.3, 22222)
return PA_EF
The first set of numbers there is a concatenated string. That's why I've put ''.
Also, this ultimately outputs into a double field. The default answer (22222), does that have to be a number or can I put 'No value'?
Solved! Go to Solution.
JohannesLindner_0-1656307083200.png
The When() function is set up correctly. If you don't get output, try these:
var A = $feature.A
var B = $feature["B_B"]
if(A=='010417192124' && B == 'Pre2000s') {
return 2.3
}
return 22222
does that have to be a number or can I put 'No value'?
It has to be a number. So either a default value like your 22222 (or the more common 99999) or you could return null, which leaves the field empty.
JohannesLindner_0-1656307083200.png
The When() function is set up correctly. If you don't get output, try these:
var A = $feature.A
var B = $feature["B_B"]
if(A=='010417192124' && B == 'Pre2000s') {
return 2.3
}
return 22222
does that have to be a number or can I put 'No value'?
It has to be a number. So either a default value like your 22222 (or the more common 99999) or you could return null, which leaves the field empty.
Thanks @JohannesLindner . This was really helpful. I think I've been having issues because Map Viewer is slow/not always implementing the expression at the moment due to the upgrade and what I shared was a simplified/shorter version.