Select to view content in your preferred language

attribute rule is not working for updating id field

114
1
Jump to solution
Thursday
Labels (2)
AmandaParisi
Emerging Contributor

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.  

AmandaParisi_0-1752767959957.png

AmandaParisi_1-1752768001026.png

 

 

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

0 Kudos
1 Solution

Accepted Solutions
CodyPatterson
MVP Regular Contributor

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

View solution in original post

1 Reply
CodyPatterson
MVP Regular Contributor

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