Error when trying to publish survey with related tables

6559
16
03-03-2017 08:33 PM
BrianHiller
Occasional Contributor

I’ve published a feature service to ArcGIS Online and one to ArcGIS Server (same data structure) which has a point feature class that has two related non-spatial tables. The relationships are built off of the global ID from the point feature class.

 

When I try to publish a form using Survey123 connect and connect to either of these services I get an error that says the parent relationship is not found. The relationship does exist at the geodatabase level and is visible in the resulting feature services. Am I missing something in the setup of the form in Survey123 Connect?

16 Replies
JosephMootz1
Occasional Contributor

I got frustrated working this same issue about a month ago and just got back to look at it. Glad I saw your post as it motivated me to try to track this down again.

What I found out is that there are some specific rules in Survey123 for related tables and as far as I can tell they are not published anywhere.

The rules are:

  1. The relationship fields must be GUID fields with the same name in the parent feature layer and the child table. The GUID field cannot be the GlobalID field.
  2. The label name of each side of the relationship must be the same.

Following these rules I created the attached relationships from your example. I created a GUID field called parentguid in both the parent feature layer and the child tables. Then I created the relationships for each table to the feature layer and labeled both sides of the relationship with the same name as shown in the attached labels image. 

When the survey form is created, the parentguid field does not appear in the spreadsheet or on the form. But, when a new inspection is created with the form, the parentguid is apparently automatically  filled in with a GUID.  When records are added to the tables in the form, their parentguid fields are automatically filled in with the parentguid from the inspections layer.

I verified the results in the REST service and the relationship and related records are there, so I think this is right.

It sounds like ESRI may be planning to support GlobalID's directly in a future release.

I pieced together the solution from the following cryptic post and help file:

https://community.esri.com/thread/192312-survey123-error-global-id-based-relationship-requires-suppo...

https://doc.arcgis.com/en/survey123/desktop/create-surveys/survey123witharcgisserver.htm#ESRI_SECTIO...

The post says 

"Survey123 does not work with GlobalID, GUID relationships for related tables (repeats) with Federated Servers yet. It is in the works but is not there just yet. I believe it may be available in the next release in April?? The repeats use ParentRowID/RelatedParentRowID for the repeats."

and

"Yes, there are a few caveats with relationships.  From your description, it sounds as if the *relationship* does not have the same name from the parent and child tables - currently Survey123 assumes the relationship name is the same"

The help file says:

"repeats cannot work with related layers or tables unless the relationship uses a GUID field for the relationship in the parent layer"

 

It is hard to understand why this is not documented somewhere obvious where we can use it. This is pretty much the traditional model for data collection in the field for things like inspections.

I hope this helps.

JamesTedrick
Esri Esteemed Contributor

Hi Joseph,

We are including the more specific requirements in the next revision of our documentation.  

DonWaldo
New Contributor II

Is there any more specific info on this? Documentation that you can point to now that we are in March of 2018?

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Don,

The documentation page for working with existing feature services, Use Survey123 with existing feature services—Survey123 for ArcGIS | ArcGIS  , is up to date.  With respect to one of the issues mentioned in this thread (relationships not having the same name on the parent and child side), this has been fixed in Survey123 Connect.

SuddhaGraves
New Contributor III

Hi James,

Can you please clarify what the relationship requirements are when using related tables?  I am publishing a service from ArcGIS Server and creating a Survey123 Form from this service.  The service includes a spatial feature and more than one related table (relationships are set in SDE and they are not nested tables).  However, the Survey123 form appears to only bring one related table and I can't figure out how to bring in the other related tables. Any thoughts?

Thanks,

Suddha

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Survey123 Connect supports 1:M(any) relationships where a GUID value is used as the relationship key.

BrianHiller
Occasional Contributor

As James mentions many of the issues that I was seeing a year ago seem to have been fixed.

James is there still a limitation on the number of relationships that a survey123 form can work with?

I am currently working with a feature service that has a point feature, related to another point feature, related to a non-spatial table. Would this number of relationships be supported? Survey123 Connect lets me publish a form using a submissionURL pointing at the feature service, however when I try to submit a record it gets stuck when submitting the record. When posting the record Survey123 shows that is gets the service information for each layer in the feature service, but stops on non-spatial related table.

I'm be happy to share the service and/or the form with you.

Brian

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Brian,

There is still a limitation of one level of repeats (parent > child).  One of the areas we will be working on in the near term is improving repeat support to allow for more levels of repeat, such as you've described with your service (parent > child > grandchild).  When we are ready for testing, we will be posting builds in the Esri Early Adopter Community.

KierenTinning2
New Contributor III

James,  we have an interesting / similar problem.  We have Survey's that are published from Survey123 Connect to our Portal (v 10.5.1) and they have multiple repeats.  In our case, they work from a collection perspective but when we look at the data in Portal, it doesn't show up.

Specifically, 

1. Add the Layer to a Map in Portal

2. Open the layer attribute table

3. Go to the end of the table (right side) you can see the tables and relationships listed

4. Click on one, the system then shows the "Name" and a number in the repeat column

5. It doesn't show the final table, where a table should be it is simply blank

Does portal have a restriction on the number of related tables (repeats)?

Thanks,

0 Kudos