PDF generation fails with parsing error only when using <<Start>> expression

Hello AppSheet Community,

I am experiencing a persistent parsing error when trying to generate a PDF from an HTML template using a Bot. I would appreciate any help or insight.

1. My Goal: I have a Bot that triggers when a “DocumentoEmitido” is created. The bot’s goal is to generate a PDF “Remisión” (Delivery Note) based on an HTML template. The template needs to display data from the main record and a list of related child records from the “DetallesOrden” (Order Details) table.

2. The Problem: The PDF generation fails with the error: Template could not be loaded due to exception: Name cannot begin with the ‘<’ character…

This error ONLY occurs when I include a <<Start: …>> expression in the HTML template to loop through the related “DetallesOrden” records. If I remove the <Start:>…<> block, the PDF generates correctly with all other data (from LOOKUPs and direct placeholders).

3. What I Have Already Tried (Debugging Steps):

We have confirmed this is not a simple syntax or data issue. Here is what we have verified:

  • Two Start Syntaxes: We tried both <<Start: [RefToOrder].[Related_Details_List]>> and <<Start: SELECT(DetallesOrden[Key], … )>>. Both fail with the same parsing error.

  • The SELECT Formula is Valid: The exact SELECT(DetallesOrden[Key], [IDOrden] = [_THISROW].[IDOrdenServicio]) formula works perfectly when used in a Virtual Column within the app. It correctly finds and lists the related records. It only fails inside the template.

  • LOOKUP and Simple Placeholders Work: The template correctly generates a PDF if it only contains simple placeholders (<<[Column]>>) and <<LOOKUP(…)>> expressions. The issue is exclusive to <Start:>.

  • File Encoding: The HTML template was created in Visual Studio Code and saved as clean UTF-8 (without BOM) to rule out encoding issues or hidden characters.

  • Data Content: We have verified that the data being looped through (e.g., in [DescripcionManualItem]) does not contain any special characters like < or > that could break the HTML structure.

  • Bot Permissions: The Bot has the “Bypass Security Filters?” option enabled.

4. My Conclusion: All evidence points to a specific bug in the AppSheet template parsing engine for my app, where it fails to process a <Start:> expression that is confirmed to be valid in other parts of the app.

5. My Question: Has anyone experienced a similar issue where <Start:> fails but LOOKUP and SELECT (in virtual columns) work correctly? Is there a known workaround or a solution besides manually building the HTML table in a virtual column (which we have done successfully, but we would prefer to use the standard <> expression)?

Thank you for your help.

if it is possible for you to share the template screenshot and related expressions in text format , the community could suggest better.

1 Like

AI gives up and blames AppSheet too easily. It’s very tiresome.

1 Like