Select to view content in your preferred language

calculate sequential letters in arcade

124
1
3 weeks ago
AmyKirkey
New Contributor

Good Afternoon,

I am looking if it is possible in Field Maps expressions to auto calculate sequential letters similar to this post:

Solved: Field calculate sequential letters - Esri Community

We have an established naming convention that I would like to keep using.

Thanks

 

0 Kudos
1 Reply
RhettZufelt
MVP Notable Contributor

Have not tried this, but appears to be supported in the calculate field in Field Maps.

Not knowing the format of the sequential letters, not sure, but perhaps you could parse off the number(s) you need to sequence.  Split them so you can feed each to a ToCharCode() which will give you the character code for that letter.  Increment this by one and you get the next sequence letter, and so on. (would have to look at the start/end numbers for caps vs lower case, etc.).

Then you could append/concatenate the individual letters together with the FromCharCode() function.

var NumCode = ToCharCode('A')
//returns number: 65

var NumCode = FromCharCode(NumCode) + FromCharCode(NumCode + 1)
// returns text: "AB"
return NumCode

Like I said, have not tested, but seems like everything needed is in there, depending of course, on what the original data looks like and what output needs to be.

In case it helps,

R_

0 Kudos