Type "other" on select_multiple

2566
6
07-11-2016 03:23 PM
JaromHlebasko
Occasional Contributor III

I have a question regarding "other" values in a select_multiple type. I want to restrict the user to only input so many characters if they decided to choose the "other" option for a multiple selection field type; however, I can only restrict the length of the field for the multiple values selected but not the "other" option. Is there a way to restrict this "other" field to a limited amount characters? Does the "other" field inherit the field length if I specify a field length for the select_multiple or_other type? I know it's a mouthful so let me know if I am not making sense.

0 Kudos
6 Replies
zkovacs
Occasional Contributor III

When you use the "other" option, it treats the question as a relevant question, although not sure where to look for the extra field and its properties. You can see them in survey123 Connect if you go to the Schema tab of your survey, but you cannot modify it there. There doesn't seem to be any entry for it in the xlsx file though. Until someone tells us where to modify the properties for the hidden "other" field in the xlsx file, you have 2 options:

1. Modify the schema of the created feature service in AGOL. You can follow the steps detailed in this blog post. You will need to know the name of the "other" field to modify its values, so make a note of it first. Once you updated the schema, you need to download the survey again to the device and it should honour the changes.

2. Instead of using the "other" option, simply create a relevant option for the question during design mode to define the field you want to display when "other" is selected. With that you can define its field length and other parameters in the xlsx form.

I hope this helps.

Zoltan

JaromHlebasko
Occasional Contributor III

When I try updating the layer definition as described in the blog post you provided, I get the following error message:

Invalid definition for 'LastEditDate'.

Invalid definition for ESRI.ArcGIS.SDS.Metadata.EditingInfo

The only thing I am changing is the length of 3 fields. Not sure what I'm doing wrong.

0 Kudos
zkovacs
Occasional Contributor III

Not sure what the data type is, I can only guess from the field name. If it's "Date", then I don't think it's wise to modify any of the properties as it may break time enabled functionalities in ArcGIS Online.

If you attach the schema I may be able to help with the changes, but no promises.

0 Kudos
JaromHlebasko
Occasional Contributor III

It is definitely not a date field that I am trying to modify. The image below is all I modified.

schema.PNG

I am trying to change the first length to 115, the second length to 230, and the third length to 2875. Other than that, I touch nothing else.

0 Kudos
zkovacs
Occasional Contributor III

Weird. I had a quick look and I get the same error when I just hit Update Layer Definition without changing anything. It seems that it has problems with the definition of 'LastEditDate' and the 'editingInfo' parent. Since AGOL stores the date information in milliseconds (converter here​), the syntax seems to be ok for me.

On the other hand, a quick search on the internet reveals that it is an issue dated back in 2014. Have a look at the 2nd comment of this blog post, there is a workaround (tried and works). Might be a good idea to take this up with Esri support as Jeff Shaner (product manager at Esri) stated that the service team was looking into this back in October, 2014...

I hope this helps.

Z

0 Kudos
IsmaelChivite
Esri Notable Contributor

Apologies for the belated response.

Using Select_One listname or other as a question type in your XLSForm will force Survey123 Connect to create an extra column in your Feature Service where the 'other' choice will be persisted. Adding the or other suffix is a handy shortcut but it has important limitations:

  • You can't translate the label of the 'Other' question
  • You can't apply any constraints or user input restrictions on the 'Other' question.

If you want to go around the limitations, it is best not to use the shortcut and construct the logic manually. In this discussion there is an explanation and sample XLSFile: Can I change "or_other" language in the select_multiple [list_name]?

Once you create the 'Other' question manually you can add hints, constraints and even set the esriFieldLength column as well.

Updating the service  schema as suggested will do no good, or will be at the very least quite risky.