AnsweredAssumed Answered

IF Else Statements in Arcade Expression

Question asked by vyntt_esrivn on Aug 28, 2018
Latest reply on Sep 4, 2018 by vyntt_esrivn

I try to create a Constraint Rule to limit the values for 2 fields which are applied 2 domains as Diameter (Double) and Material (Text). Here is my valid code and I've successfully added it. However, it always returns error when I edit feature attributes and I can't seem to understand why. 

 

var diameter = $feature.DIAMETER;
if (diameter == [24,30,36,48])
{$feature.MATERIAL == [CI, SP]}
else if (diameter == [18,20])
{$feature.MATERIAL == DI}

 

I try with other valid code as follow but it doesn't work out anyway.

 

var diameter = $feature.DIAMETER;
if (diameter == 24 || diameter == 30 || diameter == 36)
{$feature.MATERIAL == CI || $feature.MATERIAL == SP}
else if (diameter == 18 || diameter == 20)
{$feature.MATERIAL == DI}

 

Please help me correct if I was missing st and just so you know I'm not a developer so I'm really bad at this.

Outcomes