Hi,
I'm trying to run a report for a particular record in a Survey123 survey and am receiving the error below:
"An error occurred when rendering by the report engine. An error occurred when assembling data. Error message: Cannot read properties of undefined (reading 'name') The expression leads to this error: ${# IssueVisits|resultRecordCount:1|orderByFields:" OBJECTID DESC"}"
This report works fine for other records but appears to have an issue with one in particular. I'm not quite sure what "undefined (reading 'name')" is referring to so any help with that would be much appreciated. It appears to have a problem with some nested repeat sections in the report , that start with ${# IssueVisits...}. I have removed these and the report runs so could do with some help understanding what the issue is with this section for this particular record.
I have also done some further testing and built a test survey on top of the repeat above the nested repeat and then ran a report where each record in the repeat is a survey entry. Here the same syntax for ${# IssueVisits...} is used and it appears to work fine so not quite sure what the problem is.
Any help on this would be much appreciated.
Thanks
Anthony
Some further investigation into this and I think I've narrowed down the issue to the orderByFields part of my nested repeat syntax. It doesn't appear to like the use of the OBJECTID field for ordering my records. If I use a different field for ordering then the report for this record appears to work. I'm using the OBJECTID field so I can pull the latest record from the nested repeat. If someone could look into this it would be very much appreciated.
Thanks
Anthony
Hi @AnthonyJonesRSK, were you ever able to solve this issue? I am encountering the same error for a particular survey/feature layer, but it happens regardless of which records are selected and whether or not I am using orderByFields.
Thanks!
Hi @lhendricks,
Unfortunately I never got a concrete resolution to this as I raised a case with Esri, we went over it on a Teams call and typically the issue didn't reoccur on the call. For me it seemed to be a bit sporadic so I don't know if there was a particular record causing issues. I've not had to run the report for that particular project again so haven't seen the issue since. Sorry that's not much use to you so may be worth raising your own ticket if it is something that is happening consistently. If you do get a resolution, if you could share it here it would be much appreciated as I'm sure it will cause me issues again in the future!
Thanks
Anthony
@AnthonyJonesRSK or @lhendricks Did any of you found the issue with this?
I think it has to do with nested repeats but unsure how to correct it as the error message is not very helpful
I have not found a solution, but I also put the project down and haven't picked it back up yet. I will likely be revisiting it this winter. It did seem like my issue was specific to the dataset, as I was able to build a dummy version with nearly identical structure and did not encounter the issue with the dummy version!
Hi folks, I had to come back to this after the issue raised its head again for us. if anyone is still having issues with this it was the orderByFields syntax that was causing our issue. I changed the field used for sorting and sometimes it worked and for some records it didn't. It was very inconsistent.
As a workaround I found Raul's method he outlined here that got the latest repeat record using an if statement and a field counting repeats in the form. Seems to have resolved things for us so thought I'd share in case anyone else has this issue. Thanks