I am creating a PDF from a raw HTML file via automation.
It works perfectly when using a Google Doc template and perfectly with an HTML template before I add Appsheet variables enclosed with << and >>. See below.
<<[Inspection Date]>>
It errors with the message below
Template could not be loaded due to exception: Name cannot begin with the ‘<’ character, hexadecimal value 0x3C. Line 12, position 5. Error: The document body is empty"
If I escape the << >> as in <<[Inspection Date]>> it works. BUT and a big BUT….
Then the <<IF: <> and <<START: <> are not recognised (even with or without escaping the characters.
CATCH 22, there must be something wrong with the APPSHEET parser. It should be simple to just use the << >> in UTF-8 with no BOM?
You do not need to escape anything. The <<, and >> brackets are simply indicators to the template processor that Appsheet PRE processing is needed. You must use these brackets for any AppSheet columns unless they are inside of an already bracketed expression.
It seems the error message is coming from an HTML based template? You need to use the HTML version of bracketing which is like this:
I noticed deep in the AppSheet documentation that it says to use << yet others on here seem to have it working with just <<. Has anyone done an HTML template with IF and START on here?
So, I’m confused! You are showing Google Docs templates but keep mentioning HTML templates. You are are trying to get this to work with Google Docs….right?
As for the error, is this the only place you have a START/END block? I don’t see anything wrong with this part of the template.
If you have other blocks that require <>, keep in mind that improper syntax within those could lead to an error being identified elsewhere.
It might be helpful to show the entire template, if you can!!
But it’s HTML encoded - at least partially?? This is where I’m getting confused.
In Google, ignoring Excel conversions, we only have a single document type we can use for automation generation templates - Google Docs. We specify which type of template is formatted in that document. For example, “PDF” will expect the “usual” 3rd party PDF generator template formatting. Selecting “HTML” will expect formatting that uses HTML tag based formatting.
Which format selector are you choosing for the template?
NOTE: Maybe the “<<“ brackets and “< <” HTML formatting are interchangeable in a “PDF” formatted template?? I have no clue!
Looks like there’s not actually an example of using an HTML template anywhere in the examples or anywhere on this forum if there was it would prove whether the start and end directives actually work
I noticed also another user reported exactly the same problem about six months ago
Do you know under what circumstances the “<<“ brackets are required instead of the “< <” formatting?
I ask, because while I don’t have template documents, I do use HTML formatting in many email bodies. I use the “< <” formatting for AppSheet columns embedded in the HTML code. I have yet to try implementing any expressions.
I assume NOBODY has ever done a real PDF file report from an HTML template using START: or IF: Appsheet directives on here? ( I mean HTML template not a Google Doc Template)
Or is there a sample somewhere proving it works as documented by AppSheet?