I am trying to have the below expression to calculate my facilityid field based on a field value from my area field. Below is arcade expression but when I input the value in the field it is not calculating the field.
var fieldValue = $feature.WJCUD_AREA; // Get the value from the controlling field
if (fieldValue == "1") {
return concatenate("SMH-" + "1" + NextSequenceValue('MH_seq01'));
} else if (fieldValue == "2") {
return concatenate("SMH-" + "2" + NextSequenceValue('MH_seq02'));
} else if (fieldValue == "3") {
return concatenate("SMH-" + "3" + NextSequenceValue('MH_seq03'));
} else if (fieldValue == "4") {
return concatenate("SMH-" + "4" + NextSequenceValue('MH_seq04'));
} else if (fieldValue == "5") {
return concatenate("SMH-" + "5" + NextSequenceValue('MH_seq05'));
} else if (fieldValue == "6") {
return concatenate("SMH-" + "6" + NextSequenceValue('MH_seq06'));
} else {
return null;} // Or handle other cases as needed
Solved! Go to Solution.
Hey @AmandaParisi
From a surface level look, it could be that your values you're wanting to check are integers and not strings, you may be able to convert the value into text using:
var fieldValue = Text($feature.WJCUD_AREA);
Cody
Hey @AmandaParisi
From a surface level look, it could be that your values you're wanting to check are integers and not strings, you may be able to convert the value into text using:
var fieldValue = Text($feature.WJCUD_AREA);
Cody