How to add name of user as default value in Survey123?

7644
13
Jump to solution
04-25-2017 11:27 AM
RebeccaFuda
New Contributor III

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?

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
JamesTedrick
Esri Esteemed Contributor

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.

View solution in original post

13 Replies
SolomonPulapkura
Occasional Contributor III

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

https://www.vestra.com/gis     

0 Kudos
JamesTedrick
Esri Esteemed Contributor

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.

GlenGardner1
New Contributor III

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? 

0 Kudos
JamesTedrick
Esri Esteemed Contributor

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.

0 Kudos
FrankHanssen
New Contributor III

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?

0 Kudos
Manu
by
Occasional Contributor

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')

 

Lake_Worth_BeachAdmin
Occasional Contributor III

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.

0 Kudos
JamesTedrick
Esri Esteemed Contributor

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.

0 Kudos
Lake_Worth_BeachAdmin
Occasional Contributor III

Hi James i tried the calculation method and its not returning the AGOL username, my layout is below.

and the result I see is:

0 Kudos