Select to view content in your preferred language

Survey 123 - Repeat Count not allowing to publish form

4465
16
Jump to solution
12-03-2018 11:26 AM
RobertMEIER
Regular Contributor

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

16 Replies
BenjaminSperry1
Frequent Contributor

Hi Philip, Thanks for the speedy response.

I am using Survey123 3.6 with Enterprise Portal 10.7.1

I can see an attach option but the xlsx is basically this:

This has a nested repeat but I get the same results with a single repeat.

If I publish this survey, with a integer repeat count, it adds  the try_count field to the schema and becomes a permanent field in the database.

I then create a new form based on the FC created by this previous form.

If I try to set a repeat count limit I get this error:

If I don't set a repeat count limit in the original form then when I try to add one in the child form I get this error:

If I create a new field with a calculation I get the same error.

The problem started in Survey123 3.3 and so I updated to 3.6 to see if it solved the problem but the error persists.

Thank you for your help.

0 Kudos
by Anonymous User
Not applicable

Hi Benjamin,

Did you add the "try_count" field manually to the feature layer, or was it created by Survey123 Connect the first time it was published? If you are using an existing feature service and Portal you may need to add it yourself manually to the correct layer.

It appears based on your first screenshot of the xlsx form you have added the repeat count to the nested repeat, which is called "trying". This will be the name of the layer that is created in feature service. Therefore in the "try" layer, which is the parent repeat, there needs to be a field called "trying_count". Based on the error message in one of your other screenshots, there is duplicate "try_count" fields, which doesn't make sense, as for the repeat count to work with a static value there would need to be a field called "trying_count" in the layer "try" so the value can be written to it, and this field does not need to be added to the survey form.

Your other example should also work where you are using a dynamic value for the repeat count from another field, provided that field also exists in the feature layer, in this case in the parent layer.

Regards,

Phil.

0 Kudos
BenjaminSperry1
Frequent Contributor

Hi Philip,

Thanks for the guidance.

After a lot of fiddling I found that it is the order that matters.

In the original form creation you have to specify a repeat count

Which adds it to the schema of the feature:

This is added as a permanent field in the FC.

Then when you create another form based on this FC you have to delete the repeat_1_count field before you can add repeat counts.

This: (Sorry I put the repeat_count on the wrong line in this screen capture, it should be on the actual repeat)

Produces this error in the dependent form:

But when you delete those two fields:

It works:

As you suggested, each time you add a value in the "repeat_count" column it creates the ${field_name}_count.

In a dependent form if you haven't created the fields already (in the master form)  it will create them and you will get the error that it is incompatible with the URL because you have added fields.

If in the master form you did create them they will pass into the dependent form and adding a value to "repeat_count " will try to create them again, giving the error that there are duplicate fields.

If you create the ${field_name}_count fields in the master and delete them from the "survey" tab in the dependent form then it adds up and you don't get the errors.

In my case using a calculation didn't prevent Survey123 from creating the ${field_name}_count, so doing it in this order is the only thing that worked.

Thanks again, I appreciate your guidance.

by Anonymous User
Not applicable

Great, glad you got it working. Thanks for sharing your findings.

Phil.

0 Kudos
AndrewE
Occasional Contributor

I just want to make sure i'm understanding this correctly you said:

use a calculation so that the additional _count field is not required in the schema

So it is possible to use the repeat_count in a survey and not have an additional field added to my feature service.  How and where do I add this calculation. Everything I have attempted so far still results in a ${repeatname}_count being added to my schema.   

0 Kudos
deleted-user-GpZRmORkzrlh
Deactivated User

We are trying to use the repeat_count in the survey when writing to a feature service using the submission url setting. We are using Oracle so we had to change the field name in the DB to "_count" instead of "_COUNT".  Our survey publishes successfully but we are not able to submit any data. We get the error "The survey was not able to be sent due to the following error: Parent to child relationship not found". Any suggestions on how to resolve this problem? 

0 Kudos
by Anonymous User
Not applicable

Hi Kelly,

Sounds like you have a different error to the one originally posted as it indicates an issue with the relationships, can you provide a copy of the xlsx form so I can take a closer look? How did you create the existing feature service and relationships?

Phil.

0 Kudos