Hi all,
I was super excited to see ArcGIS FieldMaps using calculated expressions and conditional visibility expressions! Currently limited to file geodatabases so Immediate (or batch) calculation Attribute Rules can't be utilized yet, so this is an amazing improvement!
I have a short integer field 'CaseNumber' that needs to be incremented by 1 then reset to 1 every year. So it'd go:
| CaseYear | CaseNumber |
| 2022 | 97 |
| 2022 | 98 |
| 2022 | 99 |
| 2023 | 1 |
The expression works when I test it in the browser (See screenshot "casenumseq_browsertesting"), but in FieldMaps it says the field cannot be calculated ("Casenumseq_FieldMapsError"). FieldMaps troubleshooting logs point to line 6 in the expression where I create and filter down my featureset, the error is "Field cannot be found" ("CaseNumseq_FieldMapsLog"). Perhaps I'm creating the featureset the wrong way?
This is my expression so far;
//returns the current year
var timestam = Today()
var currentyear = Year(timestam)
//increment by 1 from highest number for only features within current year
var numberlist = Filter(FeatureSetById($datastore, /* Sites */ "0",['CaseNumber', 'CaseYear'],false), 'CaseYear=@currentyear')
var topnum = Top(OrderBy(numberlist,'CaseNumber DESC'),1)
var counter = Number(Max(topnum,'CaseNumber'))
var siteid = counter+1
return siteid
Thanks for any advice!
Caitlin