Sample ID

2463
5
09-15-2016 07:42 AM
SPNIOrganization
Occasional Contributor

Hi,

I would like to have a unique ID number for each report I make with survey123.

I know that there is an option to use the formula uuid() that returns a random UUID string, but it is too long for me.

Each report I send is written in a table and automatically have an objectID.  Maybe there is a way to show that ID in the form? or use it to calculate new Id?

Thanks,

Dikla.

Tags (1)
0 Kudos
5 Replies
JamesTedrick
Esri Esteemed Contributor

Hi Dikla,

As you noted, each entry submitted to by survey123 is automatically given an objectid - this is a required field used internally by the database and generally is not a best practice to treat as a unique ID as it could change as data is copied across different DB systems.  It's also not a best practice to have manual entry of a unique id; the chances for the same value being submitted by 2 different people is much higher than the results generated by uuid functions.

You mention that the identifier generated by uuid is too long- what is the issue involved that has a length requirement for the id?

SPNIOrganization
Occasional Contributor

Hi James,

Thank you for the response. 

The issue is finding a friendly solution for the people in the field collecting the data.

As part of the project, they are collecting items and also filling a form with information (using survey123) about each item. Because they need to connect the item to its data, there has to be an ID number that will connect the Items to the forms. The ID number is written by hand on a piece of paper that is attached to the item. This is the reason why the number should be short and easy to write during the survey in the field and also easy to be found later, not by a computer.

Hope my explanation was understandable.

Dikla.

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi, that is understandable, though a difficult problem to solve across all collection conditions.  The problem we have is creating an ID that we can guarantee is unique, even when multiple devices are possibly used by the same user (for example, if an inspector conducts a survey on one day with a tablet that later breaks and then received a new tablet with the survey loaded previously and is offline - how would we know the values needed to provide an ID that is unique?)  That being said, we are looking at what options we can support through Survey123.

0 Kudos
Jean-YvesLandry1
Occasional Contributor

Here's an idea to create a more manageable Unique ID:

1) Add the survey team number to the ID: T1, T2, T3

2) Use the Start_Survey value:  format-date(${start_survey},'%y%m%d')    

3) Create a CSV which allocates a number to every 5 min, (I assumed a team would not take more than 5 minutes to complete a survey).

surveytimetimeid
7:001
7:011
7:021
7:031
7:041
7:052
7:062
7:072
7:082
7:092

4)Based on the start_survey time value i get a timeid value:

pulldata('time_id_survey','timeid','surveytime',format-date(${start_survey},'%H:%M'))

5) Concatenate and you'll get something like T1-171123-1