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

4426
11
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

11 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.

View solution in original post

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
Lake_Worth_BeachAdmin
Regular Contributor

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
Regular Contributor

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
JamesTedrick
Esri Esteemed Contributor

Hi Joe,

The function is property('username') , not just ('username')

JevitaWebster
New Contributor III

i want to pre-populate the username but i don't want to have it shown on the survey. I just want to collect the data "username" when i run a report. Can this be done? 

0 Kudos