AnsweredAssumed Answered

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

Question asked by sgonzalez_bha on May 22, 2019
Latest reply on May 24, 2019 by JTedrick-esristaff


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.



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":





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.




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.



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."



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:



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!!!