Select to view content in your preferred language

Use csv list to suggest names, but allowing introducing data if search value don't exists

196
5
Jump to solution
11-26-2024 09:57 AM
achs
by
Emerging Contributor

Hello! 

I was using the select_one_from_file list.csv question type, but sometimes my users found new values ​​that didn't exist in my list, a workaround was to add the value in the csv file, but sometimes they can't wait for me to add it and Republish the survey. 

Is there a way to show them the list of options but also allow them to type a value if it doesn't exist?
Like a text field type would.

I saw the alternative of adding the "Other" field, when the value does not exist, but it is not an alternative for us, because we do not want to have multiple fields with answers.

¡Aprecciate your suggestions!

 

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
MikeOnzay
Frequent Contributor

To update your csv without needing to republish: Upload your csv file to your AGOL content and link it to your survey using Linked Content in Connect. Blog

 

View solution in original post

5 Replies
DuncanC
Frequent Contributor

Only if you can live with it not working offline.
https://community.esri.com/t5/arcgis-survey123-blog/survey123-tricks-of-the-trade-dynamic-lists-web/...

If you want offline to work you need to do the other field,  you can also add a 3rd field that uses a if to be filled with either the other or the selection depending on the case so it will always have the data you want in it.

ChristopherCounsell
MVP Regular Contributor
  • add a select_one from_file.csv question. Set the field binding to null and add an 'other' value.
  • Add a text question, bind to null, make relevant selected(${nullchoicequestion},'other')
  • Add your actual field as text with hidden appearance. Calculate it with an if statement to use either of the above based on other being select i.e. if(selected(${nullchoicequestion},'other'),${manualentry},${nullchoicequestion})

This gives you two dummy input questions and a hidden field that will submit the desired value.

It won't work well with the Inbox, then you'd have to add extra fields, as the null data isn't stored.

abureaux
MVP Frequent Contributor

A slight alteration. You can swap that last IF() statement for COALESCE()

coalesce(${nullchoicequestion},${manualentry})

or

coalesce(${manualentry},'other')

COALESCE() will always be the first non-empty value. Sometimes easier to use than IF() for this sort of thing.

MikeOnzay
Frequent Contributor

To update your csv without needing to republish: Upload your csv file to your AGOL content and link it to your survey using Linked Content in Connect. Blog

 

j-bromp
Regular Contributor

same as what @ChristopherCounsell  said above, i use this method in a few of my surveys. A tip is to add '~' in front of 'other' and then it will appear at the top of the list and be easily accessible.