Select to view content in your preferred language

Issue With Arrays in Arcade Field Calculation Pro 3.4

357
2
01-22-2025 06:37 PM
MattChomicky
New Contributor

I'm having a really weird issue with one of my arcade field calculation in Pro. I've been using this to calculate IDs for my features, and it's been working until I updated to 3.4 recently.

We have IDs that are a concatenation of the asset type abbreviation and an incremental integer with leading 0s, so my expression finds the current highest ID number, adds 1 to it, and returns the concatenated value with 0 padding applied.

Now, however, when I grab the highest current integer, it is giving me a NaN. Added some console statements to my expression to try and figure out what was going wrong:

MattChomicky_0-1737599820056.png

So, my list of values contains the integers, and they are properly typed as Number, until I use the First() function, at which point the value is preserved but the type changes to "Unrecognized Type", which then becomes NaN when I try to increment it.

The exact same expression results in the correct ID being generated when I try it in the Arcade Playground if I load my data up as a FeatureSet from json:

MattChomicky_1-1737599820061.png

Any suggestion how I can resolve this and get my calculation working again?

0 Kudos
2 Replies
ZachBodenner
MVP Regular Contributor

Have you tried strong-arming the "number" after the you "first" it by using the Number() function? I've had to do this in a few places where it makes no sense to need to. Basically the same as you, where I definitely feed a function a number but need to specify it is a number later using that function.

Happy mapping,
- Zach
MattChomicky
New Contributor

Good suggestion. Unfortunately, when I try this it does convert the value to a number, but it just happens that that number is NaN:

MattChomicky_0-1737656512885.png

 

 

0 Kudos