Is it possible to change Survey 123 field lengths AFTER the survey has already been published? I have an active survey with a multi line question. The esri:fieldLength cell is currently blank (defaults to 255 characters). I'm wondering if it will cause an error if I increase this value to 1000 and re-publish the survey considering this cannot be done in a typical attribute table (FAQ: Can the field length in an attribute table be modified? ).
Solved! Go to Solution.
Hello Sarah Hartholt,
Updating the field length will require the hosted feature service to be republished and will delete all previously collected data.
"You will see a message along the lines Field <fieldName> in <surveyName> length is too short 255"
Please use this link for reference regarding changes that can be made without deleting the current feature service: Publish your survey—Survey123 for ArcGIS | Documentation
A couple of options moving forward, as noted in the article you linked you can add the field to the hosted feature service with the field length you would like. You can then field calculate that new field with the existing values from the old field. In your XLSForm you can remove the old text field and add the name of the new text field, since the schema matches you should be able to update the survey without deleting the existing feature service.
Another option would be to download your existing survey results as a file geodatabase, overwrite the survey which will delete the existing data, and append the file geodatabase to the new feature service. This option is a lot more finicky and has a lot more room for additional issues.
Thank you,
Zach
Hello Sarah Hartholt,
Updating the field length will require the hosted feature service to be republished and will delete all previously collected data.
"You will see a message along the lines Field <fieldName> in <surveyName> length is too short 255"
Please use this link for reference regarding changes that can be made without deleting the current feature service: Publish your survey—Survey123 for ArcGIS | Documentation
A couple of options moving forward, as noted in the article you linked you can add the field to the hosted feature service with the field length you would like. You can then field calculate that new field with the existing values from the old field. In your XLSForm you can remove the old text field and add the name of the new text field, since the schema matches you should be able to update the survey without deleting the existing feature service.
Another option would be to download your existing survey results as a file geodatabase, overwrite the survey which will delete the existing data, and append the file geodatabase to the new feature service. This option is a lot more finicky and has a lot more room for additional issues.
Thank you,
Zach
I'm sure this is not the 'recommended' method, but I've managed to change the field length following these steps below. Note, the updated field will now be the last field in your .gdb (it will not be placed in the same location/order as before with respect to your other columns). Let's say that I made a 'comments' field and realized after the fact it was too short - 500 character limit. I want to increase the field length to 1000.
It's a lot of steps, but in the end, you now have the field 'comments' with all your original information, with the same field name. Whew!
Hi Erica:
Great timing on your post!...we ran into a problem with the length of a text field in the most recent iteration of our survey. Long saga, but we are uploading the 123 data from AGOL to a mySQL database so we could combine some legacy data with the new 123 data collection. By "we" I mean a data scientist I am working with, so I am generally just the provider of data. We somehow ended up with the existing dbase having text field length as 1536 and our upload script doesn't like the default 255 coming in from AGOL.
So, I need to update the field length without killing the existing data.
Love your idea for the work around and I am all for "whatever works" 😉
Being sort of new (1.5 years in) to S123 Connect, and GIS world in general...I need help with your Step 2. I understand as far as making a new field, say "Notes2" in AGOL, in the hosted feature layer, but have no idea how to do the "SQL engine to copy" the contents of Notes to Notes2. Are you doing this in AGOL? How?
Any tips would be greatly appreciated!
Thanks
Vicki
Hey @VickiG , yeah no problem! If you are the owner of the feature class, in the Data tab of your hosted feature layer, click on the field you want to calculate (in step 2, the 'comments2' field. A menu will come up. Click 'calculate'. Choose 'SQL'. Under 'fields', click 'comments'. This will make the field 'comments2' equal to the values in 'comments'. Click the check mark to ensure the calculation is valid. Then click calculate.
Hi Erica:
Thanks for your quick response. I see the options now in the data tab. I think our problem may have been something else in one of our python scripts that uploads data to the mySQL dbase...so will try to solve that first. Kind of doesn't make sense that it would choke on a smaller field size uploading to a larger one.
If we can fix the script, we may just decide that folks have to be brief in their S123 form comments! 😉 and leave the field length as default, rather than create more problems.
But I will try this with one of my old surveys, just to see if I can get it to work OK, I can see it being a handy tool in the future!
Thanks again! 🙂
Vicki