Beta Report: "Error occurred when querying data from the feature layer. Cannot read property 'id' of undefined"

343
4
05-22-2019 12:18 PM
Highlighted
New Contributor III

Background:

I created a feature layer with related tables from a registered SDE SQL Server database. I created Survey123 surveys using Survey123 connect to create surveys from this existing feature service. Within the web map to access the data, I use the Survey123 URL parameters to automatically update the related table's 'guid' field to be equal to the existing point's GlobalID field. I modified the 'form_id' in the XLSX file to be that of the related table.

 

Now, I experience an error creating the beta reports, seemingly because of how the Survey123 site is ingesting the feature service data, all of which previously worked when using hosted layers with identical survey templates and geodatabase schema.

 

Issue:

All of the above works fine; however, when I try to publish (beta) reports for this survey using the sample template provided by Survey123, I get "an error occurred while generating report" reading "Error occurred when querying data from the feature layer. Cannot read property 'id' of undefined":

1

 

When I access this survey from the Survey123 Website, the surveys look different than they were during testing on hosted layers. At this point, no related records exist, however, the "Record Count" for the survey is that of the existing point features.

 

2

When I click the "Data" tab, it indeed displays the existing point feature's attribute table, whereas previously it displayed the first related table's attributes.

3

 

In addition, when viewing the "Analyze" tab, the first related table's questions all have "Cannot get answers for this question. Details: unable to find the field in related feature service."

4

 

To work around this, I added a "begin/end" repeat for the first related table and set the 'form_id' to the related table's name (i.e.: "AuditPackTest"), which appeared to fix the "Analyze" table questions, partly, but seems to mess up the related table names 'squashed' into where the second related table's (i.e.: "AuditPackSubtest") headers were:

5

 

This doesn't seem to fix the "Data" tab, though, which still displays the existing points/point data, which did not previously occur. Why is it pulling this data when it's not part of the survey?? Ultimately, it seems the survey123 website is pulling from the parent feature class in ArcGIS Enterprise with Portal, but correctly pulling from the first related table when using a hosted feature layer.

 

Any help would be greatly appreciated!!!

Reply
0 Kudos
4 Replies
Highlighted
Esri Esteemed Contributor

Hi Steven,

My initial thought is there may be a mismatch between the fields as expressed in the feature service and the survey configuration - could you share both the Feature Service's JSON information (Feature Service and Layer/Table) and the XLS file?

Reply
0 Kudos
Highlighted
New Contributor III

Hey James!

Thanks for your prompt reply. I've attached the following files:

   - layer.json - the point feature class used to populate guid of related 'AuditPackTest' table

   - table.json - for the related table 'AuditPackTest'

   - subtable.json - for the table 'AuditPackSubtest' related to 'AuditPackTest'

   - AuditPackTest.xlsx - XLSX file for the AuditPackTest Survey123 survey.

Reply
0 Kudos
Highlighted
New Contributor III

James,

While I was getting those files together for you, I noticed the surveys seem to appear normal now....

1

So.... it may work now, though I haven't had the time to test it. I haven't changed any of the surveys, so I'm not quite sure what happened.

Reply
0 Kudos
Highlighted
Esri Esteemed Contributor

Hi Steven,

We just updated the website yesterday afternoon to v3.4, so it looks like the issue was resolved by the update.

Reply
0 Kudos