Thanks Yaw and Mitch.
A couple things just so we are on the same page..for each surveys instance name (file name) it's important that it includes information that is not unique so I can link household surveys together which may have been conducted at different times/days...that's why I need to pull the three location variables into the instance name of each survey. Further, knowing the surveyor for each survey will make it easier to manipulate a database of survey files in order to pull up surveys conducted by one person. Lastly, the point of the UID generation part of the instance name is to include one variable which is unique in the case that all other markers of the instance name are the same across two surveys. This string of code to create an ID does not necessarily need to be the files instance name (although desirable) but can also be a variable that is created within the survey itself and shows as a field.
I have read examples where this type of concatenated instance name is possible. When you tell me to start simply is it because adding too many variables will not work? From looking at my code, which I have checked against as many online resources as I could find, does it look like there is anything wrong with it (brackets in the wrong places, misuse of code command?, etc?)
Thank you for letting me know the UID will change each time the survey is opened. Is there a benefit to using UID() over random()?
I apologize if I am misunderstanding anything, I am teaching myself this from scratch and have read as many resources as possible but clearly still have information gaps in understanding the way examples and materials are written.
Also, be aware that the random value can change each time you open, review or edit the form. You should wrap uuid() or random() with once() to ensure that you only generate that value once. Search the list for once( for more info.
On Fri, Oct 23, 2015 at 4:54 PM, Yaw Anokwa yan...@nafundi.com wrote:
Ebony,
Start simple. Pick one of those variables and see if it works (e.g.,
concat("My Form- ",${sur}) ).
As an aside, I wouldn't use anything user entered as a true UID. Use
the $instanceID that is already in the form data. If you need
something that humans can read, that's fine, but for analysis, it may
not be unique enough.
Yaw
--
Need ODK consultants? https://nafundi.com provides form design, server
setup, in-field training, and software development for ODK.
On Sat, Oct 24, 2015 at 6:13 AM, ebony.be...@gmail.com wrote:
Hello All,
I have been spending the past little while trying to create an 'instance name' for each survey that would also serve as a UID.
After reading through the old posts in the thread regarding creating UIDs ,I cobble together the following command: in the 'settings' tab in my excel in the 'instance name' column:
concat($string(today(),' - ',${sur},' - ',${loc_001},' - ',${loc_002},' - ',${loc_003},' - ',${loc_004},' - ',${uuid()})
The goal is that the name of each individual survey will be made up of the date the survey was conducted ($string(today()), surveyor name (sur), four variables from the questionnaire indicating location (loc_001- loc_004), and finally a random number (uuid).
Unfortunately, this command does not seem to work. I have tweaked what I could think of, but I would be very grateful if a more seasoned programmer can let me know where I might be going wrong, or, an easier way to do this.
Cheers,
Ebony
--
--
Post: opend...@googlegroups.com
Unsubscribe: opendatakit...@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en
You received this message because you are subscribed to the Google Groups "ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opendatakit...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
--
Post: opend...@googlegroups.com
Unsubscribe: opendatakit...@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en
You received this message because you are subscribed to the Google Groups "ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opendatakit...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Mitch Sundt
Software Engineer
University of Washington
mitche...@gmail.com