Select to view content in your preferred language

Please explain to me how to add value to table/layer coming from survey123

690
5
07-19-2023 08:49 AM
mikAMD
by
Occasional Contributor III

When using survey123, I wish that users enter their name at the beginning of the form. At first, I wanted to automatically get this info from their AGOL account, but it seems that not all users will have an account, so they will have to enter this information manually.

So I created this user table, with the first name and last name columns. I can get this information in the survey123 form with the search() function.

This question is as a select_one type. If the user selects "other" (also included in the table where search() gets the info), then the user has to enter his or her name manually.

1st question: Is it possible to concat() values from different fields within search, so the form could show their first and last name or I need to create a new field with both their names before hand?

2nd question: How to automatically add new values added manually by user to the users tables so that search() would get this new information in the future? I know I can't create automatic field calculations on AGOL. My plan right now is run some local script every hour or so to check and update, but I'm sure there is a better option?!

Thank you.

0 Kudos
5 Replies
DougBrowning
MVP Esteemed Contributor

The way I do something like this is the 3 fields trick.  See this post for more info  https://community.esri.com/t5/arcgis-survey123-questions/quot-or-other-quot-response-on-feature-repo... 

hope that helps

mikAMD
by
Occasional Contributor III

Yeah it's a good workaround to only get one field when looking at the data from the survey in the future.

But from what I understand it doesn't answer my main question, being how to add this potential new name in my feature service user table so that future surveys will include this new name in the choices automatically.

0 Kudos
DougBrowning
MVP Esteemed Contributor

You would have to add it manually in AGOL from the data tab of your service.  I thought this was being fixed but it seems like it just warns you but does not update them which is a bummer.

The other option is to use Linked Content and have your CSV in AGOL.  Then you can update that CSV without having to update the form.  Look here https://community.esri.com/t5/arcgis-survey123-blog/work-with-csv-data-in-arcgis-survey123/ba-p/1157... 

But no, there is no way to autoupdate the list.  Which is probably good because users could mess up your list pretty fast.

mikAMD
by
Occasional Contributor III

Thanks Doug, will try it out and report back.

mikAMD
by
Occasional Contributor III

So I finally did the 3 field trick, although it's the the ideal solution. Originally I wanted to get users from the user table which meant I could associate them with a unique ID.

Instead I just get the users from the field "users" and bind this value as null. If their name is not present in the list, then they manually enter their name and bind this value as null also. Then I populate the field "users" with whichever value is present in one of the answers. This way at first the list will be empty but will populate with time based on user answers.

To generate a unique ID for them, I will have to add them manually/semi-automatically (with a script that runs every X days or so) to my users table, so still no ideal, but good workaround for now.

I'll leave the question as unanswered in case something comes up in the future...