Smart Editor: retrieve user name ?

357
4
03-10-2021 10:06 AM
Labels (1)
HélèneTouyéras
Occasional Contributor

Good evening Web AppBuilder Community!

 

I woud like to populate an operator's name using the Web AppBuilder's Smart Editor. This value should be distinct from what I can obtain from the geodatabase editor tracking.

 

I cannot find a syntax example to retrieve this value into a texte field - has anyone done this before?

 

Many thanks!

 

With kind regards,

 

Hélène

0 Kudos
4 Replies
AlixVezina
Esri Contributor

Hi @HélèneTouyéras ,

Where is the operator's name value coming from, and where should it be written into?

If I have a good understanding of what you would like to do, I think you should be able to use Preset Attribute Actions in Smart Edito to allow the editor to enter the operator's name (or you can have it set in URL parameters), and have this preset write the value into the target field(s) of your choice.

0 Kudos
HélèneTouyéras
Occasional Contributor

Hi @AlixVezina, and many thanks for your reply!

I would be happy to report the ArcGIS Enterprise username in one of my feature service's text fields. 

The idea is to mimic what Survey123 can do, because my users want to split work between field (with Survey123), and office (with a web app that uses the smart editor). I would like data to be consistent regardless of the tool used to produce it.

I could not figure out how to retrieve this value, which I supposed to be a known variable to the smart editor.

Many thanks for your advice!

With kind regards,

Helene 

0 Kudos
AlixVezina
Esri Contributor

@HélèneTouyéras ,

The Smart Editor does not currently provide the capability to grab and populate the username into a new target field, but you could provide an option for the user to manually enter their name or user name.

You can set up a Preset as shown below and pre-populate the username in the URL parameter for the person who will be editing in the app. This value will be written into the field of your choice for all newly created features.

AlixVezina_1-1615827299022.png

 

 

HélèneTouyéras
Occasional Contributor

Thanks @AlixVezina! While this cannot fit my use (too many unknown users: no way to build custom URLs for everyone), it is an excellent solution that I will use for use cases where the choice list is short & bounded.

0 Kudos