I am creating a survey for the purpose of collecting data when biological samples are collected from roadkill or other dead wildlife in the field. Usually, the person collecting the sample will be alone and therefore will also fill out the form in Survey123. However, sometimes one person will collect the sample while another person will fill out the form. I would like to create a field called "Sampled by:" with a default value of the name of the survey user. Is this possible in Survey123?
Solved! Go to Solution.
Hi Rebecca,
you can prepopulate the username of a user using the property("username") function in the default or calculate column; we don't have a method for putting in the full name.
Is this a feature service hosted in ArcGIS Online? If so, you can turn editor tracking on and it will record who made the changes.
Solomon Pulapkura
Hi Rebecca,
you can prepopulate the username of a user using the property("username") function in the default or calculate column; we don't have a method for putting in the full name.
Does this function run in app code or is this in the geodatabase? I am wondering if I can add the function to the Feature Template so it works if I add the feature service to a web map used by a collector app as well.
Is this pulling the ArcGIS Online account user?
Hi Glen,
For services hosted in ArcGIS Online, this will pull in the ArcGIS Online username. The way specified above is within the Survey123 app only; however, with Editor Tracking, you have a (non-visible by default) field that records the username that both Survey123 and Collector use. See Manage hosted feature layers—ArcGIS Online Help | ArcGIS for more information.
Hi James! I am creating a citizen science survey in (Survey123 Connect). The survey will be open and I would like to generate unique alias names for each user. Is this possible in XLS forms?
For readers who find this question in 2022:
Apparently, the property()-function is no longer available (see https://support.esri.com/en/technical-article/000022833)
Now, you should use the following code, with 'username' as 'propertyname':
pulldata("@property", 'propertyname')
hello James,
I have a survey with a name field and want to pre-populate with the users signed in AGOL username. In the default column what is the method to use for this? ("username") - literally translates to text in the field. I read a blog about this but cannot find it anywhere.
Hi Joe,
There are 2 ways to accomplish this:
- use a question of type username
- have the function property('username') in the calculation column of a text, hidden, or calculate question
Also note that this is normally stored in the Editor Tracking fields automatically.
Hi James i tried the calculation method and its not returning the AGOL username, my layout is below.
and the result I see is: