Hi,
I am trying to create an arcade expression for my labels in the map
The following is the expression I have done - but on the second line - when I test - it says if "assignments not be made in logical tests"
if (!IsEmpty($feature.OPERATIONALID)) {$feature.ASSETID}
else if ($feature.OPERATIONALID = $feature.ASSETID) {$feature.ASSETID}
else {$feature.ASSETID + " (" + $feature.OPERATIONALID + ")"}
What am I doing wrong.
Basic logic is:
If OperationalID is null or empty then label assetID, if operationalID = AssetID, label AssetID, else label a concatenation of assetID + OperationalID
Solved! Go to Solution.
I've only a basic javascript knowledge, but it seems like you have a rogue "!" before isEmpty(),
and $feature.OPERATIONALID = $feature.ASSETID is an attempted assignment without a 'var' etc. I'd say it should be a comparison operator "==" $feature.OPERATIONALID == $feature.ASSETID.
if (IsEmpty($feature.OPERATIONALID)) {$feature.ASSETID}
else if ($feature.OPERATIONALID == $feature.ASSETID) {$feature.ASSETID}
else {$feature.ASSETID + " (" + $feature.OPERATIONALID + ")"}
I've only a basic javascript knowledge, but it seems like you have a rogue "!" before isEmpty(),
and $feature.OPERATIONALID = $feature.ASSETID is an attempted assignment without a 'var' etc. I'd say it should be a comparison operator "==" $feature.OPERATIONALID == $feature.ASSETID.
if (IsEmpty($feature.OPERATIONALID)) {$feature.ASSETID}
else if ($feature.OPERATIONALID == $feature.ASSETID) {$feature.ASSETID}
else {$feature.ASSETID + " (" + $feature.OPERATIONALID + ")"}
Thanks David - works perfectly