Select to view content in your preferred language

Maintain count variable between scheduled notebook tasks?

501
2
Jump to solution
12-07-2023 03:38 PM
Labels (1)
ChristopherCounsell
MVP Regular Contributor

Hi,

Have an ID field with a mix of string and integer values.

I'd like to run a scheduled notebook to update the ID field with the next highest available integer id.

There's some obvious issues doing this with a string field containing string values. I'd like to avoid processing the field to identify the current highest ID each scheduled run.

Is it possible to set a count value, increment it for new features, and then have the current highest value persist between each scheduled notebook task?

i.e. count = get highest integer value in field (once)

count = 1000
scheduled task runs over a few features, count = 1003
next time the scheduled task runs, count = 1004

0 Kudos
1 Solution

Accepted Solutions
BobBooth1
Esri Contributor

You could save the current value in a text file in the notebooks files\home folder at the end of each run, and read it at the beginning of the next one.

View solution in original post

2 Replies
BobBooth1
Esri Contributor

You could save the current value in a text file in the notebooks files\home folder at the end of each run, and read it at the beginning of the next one.

ChristopherCounsell
MVP Regular Contributor

Thanks, worked a treat

0 Kudos