Survey 123 - Repeat Count not allowing to publish form

1021
16
12-03-2018 11:26 AM
Highlighted
New Contributor III

I have a related table in my service and when I set the repeat count and try and republish, it says 1 field does not exist in the feature layer.

I have a log file set up for survey 123 and can see it checking for a field called <my repeat table name>_count (RampInspection_count) and then saying it can't find it.

I have attached the log file.

FYI, even if I put zero in the count, I still get the error, only of it is blank can I republish the survey.

Do I have to add this column to my feature layer?

Thanks!

-bert

Reply
0 Kudos
16 Replies
Highlighted
Esri Frequent Contributor

Hi Robert,

This is a bug we have seen before, however I believe it has been resolved.

Based on the logs, it appears you are using version 3.0 of Survey123 Connect, have you tested with 3.1? Also, there is a beta version available on EAC if you can also test with the latest version?

Are you publishing to AGO or Portal, if so what version? 

Phil.

Reply
0 Kudos
Highlighted
New Contributor III

I have updated Connect to 3.1 and the issue still exists. I am publishing to AGOL. The only wrinkle in the Survey is that I have nested repeat for images.

Here is the latest log file.

Thanks for the help!

Reply
0 Kudos
Highlighted
Esri Frequent Contributor

Hi Robert,

Can you please also share your survey xlsx file too, I would like to see the configuration of the questions and try to reproduce the error with your survey.

Regards,

Phil.

Reply
0 Kudos
Highlighted
New Contributor III

Here is the Survey form, thanks for taking a look.

Reply
0 Kudos
Highlighted
Esri Frequent Contributor

Hi Robert,

After looking into this issue more and understanding exactly how repeat_count works, when using a static value in the xslx form for repeat_count, a new field will automatically be added to the feature layer to store the value entered. This is required so that the field app can retrieve the stored value to then load the correct number of records in that repeat.

Therefore you will need a field in your feature layer called ${repeatname}_count where the ${repeatname} is the name of your begin repeat question that has the repeat_count applied. This can be created as read only and even hidden so that it is not displayed on the form in the field app.

Alternatively, you can reference another field in the repeat_count column instead of using a static value or use a calculation so that the additional _count field is not required in the schema. The field app will then use the value stored in the other field that already exists or based on the value being calculated.

Hope this helps.

Phil.

Highlighted
New Contributor III

I started by adding the field to the feature service related table called RampInspection. The begin repeat section name is RampInspection, so I added RampInspection_count as an integer field. Then deleted that field from the related table and added the same field to the feature layer. Both times I got the errors detailed below.

Then in the survey I added a hidden question with the name RampInspection_count, set the label to Ramp Inspection count and esri:fieldType to esriFieldTypeInteger. I tried adding the field to the repeat section, to the main feature layer section (group) and outside of both and I still am getting error messages when I save the excel doc.

If the question is added to either the repeat section or main feature layer group the message reads:

if the field is added outside of both the message reads:


Reply
0 Kudos
Highlighted
Esri Frequent Contributor

Hi Robert,

The _count field needs to be in the parent, not in the related table as the repeat has to reference it from the parent layer.

However when trying to manually add it to existing feature service, it appears the repeat_count static value is still auto-creating the field in the schema in Connect, you should be able to view this in Connect and in the schema view of the survey. You should see two fields names the same now. You can try creating the field with exact same settings and config, it should be read only also.

If that still doesn't work, the only other option for you with the existing feature service is to create a new integer field as a hidden field type, call it whatever you want but not_count, add the new field name to your survey xlsx file, and put the repeat count value you want in the calculation column of that new field in the xlsform, and then reference the question name in the repeat_count field to the begin repeat question.

Let me know how you go with that, but it will work.

Phil.

Reply
0 Kudos
Highlighted
Occasional Contributor

Hi Philip,

I am running Survey123 3.6 and am encountering this same problem. The solutions you suggest do not work in my case.

There has to be something else going on because I have several forms that have no problem with relate counts but even my test forms have run into the error.

Any advances on this recently?

Thanks

Reply
0 Kudos
Highlighted
Esri Frequent Contributor

Hi Benjamin,

Can you please provide more details and share your xlsx form, and more specific information about if you are using AGO or Portal (is so what version)? Are you using an existing feature service? How are you using repeat count in your form?

Phil.

Reply
0 Kudos