Hi all,
I am using the Vary Symbology by Attribute and I need to write an Arcade expression that returns a value if two conditions are met. Below is what I have, but it has an error somewhere I can't find.
See screenshot attached image for error.
Is anybody able to offer some help?
if ($feature.explosives_manufacturer == 'SMASH') &&
($feature.Controller_Name__Current_ == 'ALC') {return 2;}
else {return 1;}
Solved! Go to Solution.
if ($feature.explosives_manufacturer == 'SMASH' &&
$feature.Controller_Name__Current_ == 'ALC')
{return 2}
else if ($feature.explosives_manufacturer == 'SMASH' &&
$feature.Controller_Name__Current_ == 'QVC')
{return 3}
else {return 1}
if ($feature.explosives_manufacturer == 'SMASH' &&
$feature.Controller_Name__Current_ == 'ALC') {return 2}
else {return 1}
This is perfect! I do have a quick follow-up, how could I expand the code to write more statements? Such as this, but this is wrong and doesn't work;
if ($feature.explosives_manufacturer == 'SMASH' &&
$feature.Controller_Name__Current_ == 'ALC') {return 2}
else {return 1}
||
if ($feature.explosives_manufacturer == 'SMASH' &&
$feature.Controller_Name__Current_ == 'QVC') {return 3}
else {return 1}
Had to edit the code in the post for a clearer explanation.
if ($feature.explosives_manufacturer == 'SMASH' &&
$feature.Controller_Name__Current_ == 'ALC')
{return 2}
else if ($feature.explosives_manufacturer == 'SMASH' &&
$feature.Controller_Name__Current_ == 'QVC')
{return 3}
else {return 1}