Hi all
I'm trying to create a report based off a Survey123 form. The form contains essentially three tables (one main table, linking to two other tables on one-to-many joins using GlobalIDs) and no geometry.
When I go to the Survey123 website and try to create a sample report template, I get the following error:
206: An error occurred when rendering by the report engine. The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined
Alternatively, if I go to quick reference, I get the following:
701: An error occurred when generating field mapping json. The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined
Any ideas? Can't find anything about this yet (though I've not had much of a look so far). Nearest I've found has been a generic thing on another site: https://communityhub.sage.com/us/sage_x3/f/general-discussion/202821/got-error-message---the-first-a...
I have no idea what I was doing wrong but I created a report template for another layer and then modified it to work with the tables, so all good.
Hi Michael,
This specific error (206 / 701 regarding Received undefined) almost always triggers when the Survey123 report engine tries to parse a nested relationship (Repeat block) where it cannot find or resolve the expected field mappings, schema, or GlobalID keys.
Since you mentioned your schema has no geometry and relies heavily on one-to-many joins using GlobalIDs across three tables, here are the most common culprits and how to fix them:
If you generated the default template from the Survey123 website, check your Microsoft Word template (.docx) file. The report engine throws an undefined error if your syntax for the related tables isn't closed properly or handles empty records poorly.
Ensure your repeat sections start with ${#Related_Table_Name} and end correctly with ${/Related_Table_Name}.
If a parent record does not have any related records in those joined tables yet, the engine can fail on "undefined" data. Try wrapping your repeat block in an open conditional check to see if records exist:
${if Related_Table_Name}
${#Related_Table_Name}
${Field_Name}
${/Related_Table_Name}
${/}Survey123 feature layer views or relationship classes can sometimes mask or alter field types when published without geometry.
Go to your Survey123 Data tab, look at the schema of the related tables, and make sure the primary/foreign key fields (GlobalID/ParentGlobalID) are explicitly mapped and populated. If the engine looks for a parent join key and hits a null or unmapped field definition in the Feature Service JSON, it crashes before rendering.
Are you generating this report directly from the main feature layer, or a Survey123 Stakeholder/Fieldworker View?
If you are using a View layer, ensure that the View actually includes the related tables and has "Queries" enabled on them. If the view restricts access to the child tables, the report engine hits an empty object (undefined) when trying to generate the field mapping JSON.
Quick Troubleshooting Step: Try submitting a mock survey response where every single table has at least one entry, then attempt to generate the "Quick Reference" or sample template again. If it passes, your issue is definitely how the report engine handles empty child tables, and adding the ${if} conditional checks inside your Word template will fix it permanently.
Let us know if this clears the error!