Adding More Fields to Existing Repeat in Survey123

2090
5
Jump to solution
08-22-2019 12:48 PM
joerodmey
MVP Alum

I have an existing Survey123 form with a repeat. I want to add more fields to the repeat. Will this cause any errors or throw off my existing data?

2 Solutions

Accepted Solutions
by Anonymous User
Not applicable

Hi Joe,

Yes, you can add more fields (new questions) to repeats. The safest way to do this is to modify the schema of the feature layer in AGO/Portal or via ArcGIS Pro/Desktop or via the REST endpoint. This allows you to make the required changes to the related layer (add a new field) safely in the feature service. You can then add that field to the xlsx form in Connect by adding a new question in the begin repeat section of that related table, and give it the same name in the name column as the new field name you added. When re-publishing it will find that this field already exists and publish successfully.

Currently there is a known limitation with re-publishing the survey if you try to add the new field in the survey xslxform directly, without adding it to feature layer first. Connect may fail to publish and hang in some cases.

Phil.

View solution in original post

by Anonymous User
Not applicable

Hi @juanrios87,

It is not possible to add a repeat to an existing survey, if you already have data, as that causes a schema change which will mean the feature service is created again to reflect the new schema changes, if you try to republish from Connect.

The best way is to use ArcGIS Pro and the tools available to add the related table/layer and set up the relationships, and then update yrou survey XLSForm to match the new schema, or create anew survey based on existing feature service.

Regards,

Phil.

View solution in original post

0 Kudos
5 Replies
by Anonymous User
Not applicable

Hi Joe,

Yes, you can add more fields (new questions) to repeats. The safest way to do this is to modify the schema of the feature layer in AGO/Portal or via ArcGIS Pro/Desktop or via the REST endpoint. This allows you to make the required changes to the related layer (add a new field) safely in the feature service. You can then add that field to the xlsx form in Connect by adding a new question in the begin repeat section of that related table, and give it the same name in the name column as the new field name you added. When re-publishing it will find that this field already exists and publish successfully.

Currently there is a known limitation with re-publishing the survey if you try to add the new field in the survey xslxform directly, without adding it to feature layer first. Connect may fail to publish and hang in some cases.

Phil.

joerodmey
MVP Alum

Hi Philip Wilson

My data wont be deleted following these steps?

Thanks

0 Kudos
by Anonymous User
Not applicable

Hi Joe,

If you are only adding a new field to the feature layer/table, then no, data should not be deleted from the existing fields in the same layer/table. However, it is always a good idea to back up your feature service (export to fgdb or create a copy), before modifying the schema via any of the above suggested ways.

Phil.

0 Kudos
juanrios87
New Contributor

Hi Philip,

Is there a safe way to add a repeat to an existing form? 

0 Kudos
by Anonymous User
Not applicable

Hi @juanrios87,

It is not possible to add a repeat to an existing survey, if you already have data, as that causes a schema change which will mean the feature service is created again to reflect the new schema changes, if you try to republish from Connect.

The best way is to use ArcGIS Pro and the tools available to add the related table/layer and set up the relationships, and then update yrou survey XLSForm to match the new schema, or create anew survey based on existing feature service.

Regards,

Phil.

0 Kudos