Select to view content in your preferred language

Dynamically Updating Survey123 Select One List

811
3
Jump to solution
07-25-2024 09:23 AM
CN
by
Occasional Contributor

I have a large agricultural producer list (around 10,000 choices).  For performance, I created an external csv list (select_one_from_file with autocomplete)  and it is working great but occasionally the client needs to add a new producer to that list.  I know there are now some options to do this but i want to make sure i do not lose performance doing so. Also updating the list will be random in some cases.  Our client could go out to a site and realize at the site with the survey open that the desired producer is not in the choice list. So i was thinking of adding an "Other" option to the csv list and a relevant question associated with that for storage of on-the-fly new producer names. Then there would be another column in the feature service table so when "Other" is entered then "Name" of the new producer would be next to it and we could use that to add the new producer to the csv list.  I know there are several ways to update external csv list (python api, via Connect, etc, etc) but wondering best approach to addressing this scenario.  Thanks. 

0 Kudos
1 Solution

Accepted Solutions
MattEdrich
Frequent Contributor

My surveys make frequent use of an "Other" choice triggering a freeform input for atypical responses to a standardized question, so I think that is a good strategy for your field technicians. However, I'm not sure if there is a good way to automate the periodic reviews of the specific responses to the "Other" field it is used - you'd need to find unique values there, and then make sure that the `name` and `label` fields for your standardized choice list are added in a way that works for you. This might be easiest to simply do manually so that you can be sure the new values there are what you want them to be.

Once that part is done, I think you can just update the .CSV file locally, and then use this ArcGIS Notebook approach to handle updating the item on AGOL (not sure if this is faster/better than doing this part yourself!). With the .CSV item updated in AGOL, I think that you'll want to verify the fact that your users will actually see an updated choice list, which if it was me I would do by going into Survey123 Connect, making sure the linked content is up to date, and republishing the survey.

View solution in original post

0 Kudos
3 Replies
MattEdrich
Frequent Contributor

My surveys make frequent use of an "Other" choice triggering a freeform input for atypical responses to a standardized question, so I think that is a good strategy for your field technicians. However, I'm not sure if there is a good way to automate the periodic reviews of the specific responses to the "Other" field it is used - you'd need to find unique values there, and then make sure that the `name` and `label` fields for your standardized choice list are added in a way that works for you. This might be easiest to simply do manually so that you can be sure the new values there are what you want them to be.

Once that part is done, I think you can just update the .CSV file locally, and then use this ArcGIS Notebook approach to handle updating the item on AGOL (not sure if this is faster/better than doing this part yourself!). With the .CSV item updated in AGOL, I think that you'll want to verify the fact that your users will actually see an updated choice list, which if it was me I would do by going into Survey123 Connect, making sure the linked content is up to date, and republishing the survey.

0 Kudos
CN
by
Occasional Contributor

Thanks Matt.  This was the path i was considering before i created this post.  I will use the "Other" field and then use python/Python API logic to check to make sure the "Other" values in the freeform input do not match any existing choice values in the csv list. If they don't match, i will have the script update the csv list and then push the update to AGOL.  If the push via Python API/Notebook ends up being unreliable, i will do as you suggested, and manually update via connect and make sure the new name is in the choice list. Have a good one. 

0 Kudos
CherylWheeler11
Regular Contributor

Hi Matt,

I would be very interested in seeing your code to accomplish this, if it is possible to share. 

Feel free to dm if you prefer.

Many thanks

 

0 Kudos