Select to view content in your preferred language

Auto Increment integer using Survey123

24448
31
Jump to solution
02-02-2016 10:17 AM
RhondaThynne
Regular Contributor

Would it be possible to auto increment an integer field (within a Repeat) calculated from the previous entry; on the same field?

For example: during our fish surveys we can catch up to 30 fish at one site. Each fish needs be be measured and weighed and have a Fish Number.  The first fish caught would be "1", second fish "2", third fish "3" etc.

So, it would be fantastic (within a Repeat) after the first fish information is entered, the survey form would auto-populate the Fish Number field with "2" and so on.

I understand there are still some bugs with Repeat's but just wondering if this would be a possibility down the road!! Even if this could be accomplished outside of a repeat, it would still be useful!!

Thank you

31 Replies
JamesTedrick
Esri Esteemed Contributor

Timothy, James,

We posted a blog on generating unique identifiers a bit ago in Creating 'Ticket Numbers' in Survey123 for ArcGIS .  From our understanding of the request, auto-incrementing is primarily to generate a unique number.  While this works when limited to one device or possibly a connected scenario, it becomes much more difficult when dealing with multiple devices, especially when disconnected- there isn't an effective way for a device to tell the others it has 'claimed' the next number and they should update.  An alternate approach would be to allocate numbers to users before going out to the field by creating blank records and use the Inbox to store them.

0 Kudos
KevinBrown10
Occasional Contributor

The scenario I am interested in (and I believe others) is to have the auto-increment to occur within a repeat of a survey.  I am not necessarily interested in generating a unique identifier between survey instances.  For example, we often collect numerous samples at a singular location.  The location identifier is populated on the main level of the survey and sample information is captured within a repeat.  I would like the sample ID to be auto-generated such that I use a calculation that uses the location identifier and then appends the sample number which is equal to the record number in the repeat.  For example, the series would be Location1-Sample1, Location1-Sample2, Location1-Sample3, and so on. 

LorettaWinton1
Regular Contributor

Actually both the scenarios mentioned above would be super useful.

Scenario 1: Auto increment  to get unique identifier between different survey instances. eg. Different plots, streams or whatever. eg, Plot-1, Plot-2, etc. To avoid the problem of different people perhaps having identical numbers, different crews could use a local feature like stream name, their initials or whatever, eg. YukonRiver-1, YukonRiver-2 (Where YukonRiver is some text entered in the field by a user, and it auto increments for each instance/record.) Another Surveyor on the Kuskokwim River would enter that.

Scenario 2: Auto increment repeats within each survey instance/record. Eg. at YukonRiver-1 20 fish are sampled, such that one would have {plotname-plot#-fish-fish#}. YukonRiver-1-Fish-1 and so on.

Thanks,

Lori

0 Kudos
JamesBlodgett
Deactivated User

I use tree tags, like fish tag, but would also like to be able to change the sequence.

In another company's form, Auto Increment is simple. Tree 1, 2, 3, 4, ... 21. But I can still change the number in the form, and it Auto Increments from the new number.

(e.g., Tree 1, 2, 3, 4, ... 21, 100, 101, 102, 103, ...).

So I hope there are various Auto Increment options, since I see the uses of the more complicated ones others suggest.

At present, I just need a simple Auto Increment function that is common in other e-forms.

KevinMitchell1
Emerging Contributor

Is this function still unavailable?

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Kaylee,

Survey123 does not support auto-incrementation in the form due to the issues of submission by multiple submitters.  There are other ways to provide identifiers, see Creating 'Ticket Numbers' in Survey123 for ArcGIS.

Additionally, if a sequence of numbers needs to be pre-assigned to a collector, you can accomplish that by generating the (empty) rows before submission (with id numbers), allocate them by assigning rows to the collector(s) and then use the Inbox so that the rows are then loaded into the device for completion.

ChristiGabriel1
Emerging Contributor

Hi James: What is the easiest process for generating empty rows? Can the rows be allocated to a device, queried by the inbox, and then completed?

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Christi,

There are a few different methods to this.  Given my skillset and background, I would tend to use a Python Script that I could use an InsertCursor (InsertCursor—Data Access module | ArcGIS Desktop ) with to create new rows.  A similar tool would be the ArcGIS API for Python's FeatureLayer.edit_features() method (arcgis.features module — arcgis 1.6.2 documentation )

0 Kudos
ChristiGabriel1
Emerging Contributor

So, can the inbox be queried by the Device ID or is this functionality still not available? Once I have my blank rows, I want to filter the inbox by the current device and auto-increment that way.

0 Kudos
DeonLengton
Esri Contributor

No dont think that is possible

0 Kudos