Hi there, very new to the world of Arcade and i'm failing miserably it seems. What I am trying to do is create 3 symbology levels 'Severe Danger', 'Medium Risk' and 'Low' based on 2 attribute fields. riskrangehuman and riskrangeproperty that are updated offline and I want the symbology of the points to change based on the information entered,
If the value in riskrangehuman is 3 or 2 AND the value in riskrangeproperty is 3 I want it to be categorised as 'Severe Danger'
If the value in riskrangehuman is 2 AND the value in riskrangeproperty is 3, I want it to be categorised as 'Medium Danger'
For everything else I want it to be symbolised as 'Low Risk'
When($feature.riskrangehuman == '3' || $feature.riskrangehuman == '2') && ($feature.riskrangeproperty == '3'), 'Severe Danger'
($feature.riskrangehuman == '2') && ($feature.riskrangeproperty == '3' || $feature.riskrangeproperty == '2'), 'Medium Risk',
'Low risk' )
I get an error saying "Parse Error:Line 4: Unexpected token )"
Any help would be really appreciated
Solved! Go to Solution.
Welcome to the world of Arcade! Here's what I can see:
As far as the conditions themselves, however, your expression doesn't quite match up with your text. For both "Severe" and "Medium", riskrangeproperty, according to your post, should equal 3. And "Severe" has a riskrangehuman of 2 OR 3, but "Medium" has it as a 2. By that logic, any feature that meets the "Medium" criteria will also meet the "Severe" criteria.
Then again, your expression seems to have 2 OR 3 for riskrangeproperty in the "Medium" condition. So it's not totally clear which is the intended approach. I'll just assume the expression is the one to follow.
Here's your expression, with those suggestions implemented:
var rrh = $feature.riskrangehuman
var rrp = $feature.riskrangeproperty
When(
Includes(['2', '3'], rrh) && rrp == '3', 'Severe Danger',
rrh == '2' && Includes(['2', '3'], rrp), 'Medium Risk',
'Low risk'
)
The comma and parenthesis are definite must-fix items, but the rest are more personal preference. See what works for you!
Welcome to the world of Arcade! Here's what I can see:
As far as the conditions themselves, however, your expression doesn't quite match up with your text. For both "Severe" and "Medium", riskrangeproperty, according to your post, should equal 3. And "Severe" has a riskrangehuman of 2 OR 3, but "Medium" has it as a 2. By that logic, any feature that meets the "Medium" criteria will also meet the "Severe" criteria.
Then again, your expression seems to have 2 OR 3 for riskrangeproperty in the "Medium" condition. So it's not totally clear which is the intended approach. I'll just assume the expression is the one to follow.
Here's your expression, with those suggestions implemented:
var rrh = $feature.riskrangehuman
var rrp = $feature.riskrangeproperty
When(
Includes(['2', '3'], rrh) && rrp == '3', 'Severe Danger',
rrh == '2' && Includes(['2', '3'], rrp), 'Medium Risk',
'Low risk'
)
The comma and parenthesis are definite must-fix items, but the rest are more personal preference. See what works for you!
Perfect, thank you so much!