IF statement to generate Unique ID'S - Arcade Calculation Rules

130
0
03-12-2024 05:26 AM
JonahW
by
New Contributor III

Hey I'm trying to migrate our Attribute Assistant rules from Desktop to Pro and ran into some issues with trying to configure the calculation rules  to generate our system valve Unique ID. Within Attribute Assistant we had 2 expressions to generate our ID's

1) Generate a unique ID on the FACILITYID field - ex 14000

2) Next an expression was created to select the HYDRANTFLAG = Yes then add "HV-" + FacilityID, also if the ValveType was 300 then "AV-" + FacilityID

 

image1.PNG

 

 Within Arcade I'm currently using 2 rules

image2.PNG

 

Rule 1 code:

var id = NextSequenceValue("wSysV_Seq");
return id

I'm having trouble with part 2, my goal is that when:

  • the field ACTIVEFLAG = "Yes" then the FacilityID  = "HV-" + FacilityID
  • If ValveType= 300 then FacilityID = "AV-"+ FacilityID
  • then the rest should be "MV-" + FacilityID

 

I'm still new to Arcade so thank you for helping out in advance. 

0 Kudos
0 Replies