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.

1 Like

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

We are having the same problem and reported it to Appsheet, but we don’t seem to be getting anywhere.

We have also followed the exact steps you outlined.

We are using a simple test function that works in a Google Doc template, but not in an HTML template.

We have also tried replacing << >> with &lt&lt gt&gt to bypass the “Name cannot begin with the ‘<’ character, hexadecimal value 0x3C” error that occurs when using << >> in a HTML Template.

Function Below:

&lt<START: SELECT(Report Options[ID], [Show]=“Y”)&gt> Test &lt<END&gt>

We are happy for you to communicate with us directly so we can resolve this.

I encountered the same problem when using << Start : … >> in a table format. If you use it on a table, the << End >> should also be in the same row.

Maybe this is the reason why it’s not working for you? Try avoiding setting them up (start and end expressions) in different rows. If necessary you may want to add a table inside that row instead :sweat_smile:.

Hope this helps :folded_hands:t2:

1 Like