Select to view content in your preferred language

Re-publish due to field size

224
2
Jump to solution
10-17-2024 03:31 PM
ChrisHertel
Emerging Contributor

Hi All,

I just published a survey, made some quick changes and went to re-publish, however I received an error that a field length is to short.  See attached image.  I do not want to lose data.  I have done this before and submitters could not see their records.  I do not recall changing this fields character length.  I made the field larger than 255 and still got the following error.  Is there a fix so I can re-publish without the loss of data.

IMG_5323.jpeg

0 Kudos
1 Solution

Accepted Solutions
ChristopherCounsell
MVP Regular Contributor

When you publish text questions from Survey123 you can set a field length on the string field. By default it's commonly 255 or 256.

If you republish a survey and the text question field length binding is different to what is on the layer, Survey123 Connect will have to delete the field and recreate it in order to set the field length to be different. It does this by re-writing the entire feature service, which is the warning you are seeing now.

Find your Hosted Feature Layer. Go to Item Details > Data > Fields.

What field length is on the field HIF_notes in the existing, published layer?

Once you know this set your form to match it in the field length binding columns.

If you need the field length to be longer you will need to recreate the field manually. You can do this by:

  1. Backup your data.
  2. Create an additional text field called 'temp'.
  3. Calculate your existing Notes field data into 'temp' and check the results.
  4. Delete the Notes field.
  5. Create the Notes field with the desired field length e.g. 1000.
  6. Calculate the Notes field with the temp field data. Check the results.
  7. Delete the temp field
  8. Set the survey field length to 1000 and republish (without warnings and issue).

This effectively allows you to recreate the field while preserving existing data.

View solution in original post

0 Kudos
2 Replies
ChristopherCounsell
MVP Regular Contributor

When you publish text questions from Survey123 you can set a field length on the string field. By default it's commonly 255 or 256.

If you republish a survey and the text question field length binding is different to what is on the layer, Survey123 Connect will have to delete the field and recreate it in order to set the field length to be different. It does this by re-writing the entire feature service, which is the warning you are seeing now.

Find your Hosted Feature Layer. Go to Item Details > Data > Fields.

What field length is on the field HIF_notes in the existing, published layer?

Once you know this set your form to match it in the field length binding columns.

If you need the field length to be longer you will need to recreate the field manually. You can do this by:

  1. Backup your data.
  2. Create an additional text field called 'temp'.
  3. Calculate your existing Notes field data into 'temp' and check the results.
  4. Delete the Notes field.
  5. Create the Notes field with the desired field length e.g. 1000.
  6. Calculate the Notes field with the temp field data. Check the results.
  7. Delete the temp field
  8. Set the survey field length to 1000 and republish (without warnings and issue).

This effectively allows you to recreate the field while preserving existing data.

0 Kudos
ChrisHertel
Emerging Contributor

Thanks!  This worked.  New to the program and still learning.