Select to view content in your preferred language

Calculate Sequential Integer for Repeats

2034
11
Jump to solution
05-02-2024 01:08 PM
Blevins_Mark
Frequent Contributor

Is there a method to calculate a sequential integer field for the number of repeats, more specifically for a photo number. I want to populate a field as I add photo repeats, so that I have photo #1, photo #2, photo #3, etc...i was doing this using a count calculation, but have found that if i go back to a previous record before i submit the survey, the photo # value gets repopulated with the total (ie if i have 5 photo repeats all the photo #s get recalculated to "5", rather than 1, 2, 3, 4, 5.

Thanks

0 Kudos
11 Replies
JustinH
Frequent Contributor

Maybe someone here can help me. I am trying to add just one to the previous value on a repeat, which seems to be the same for all of you. However, using count() or position() returns an invalid error. Do I need a default value? What is the trick here? I am doing once(count(${TreeNumber})+1)

 

Update: This seems to work when I create a new field just fine but I am trying to calculate this within the TreeNumber field that way when they add a repeat, the tree number goes from 1 to 2. Seems simple but I keep getting an error. 

0 Kudos
DougBrowning
MVP Esteemed Contributor

What is the field type?  If you use note it defaults to string.  

You can use bind::esri type

or set to integer then appearance to hidden.

Hard to tell without the form.

0 Kudos