Template errors

Detect and fix errors in your templates

With Doxey you can generate sophisticated documents from your templates by using tables, nested conditions, loops and more.

As you have a lot of powerful features, you will also have a lot of ways to produce errors. To help you track down errors in your templates Doxey will display error messages right in your generated documents when generating documents in test mode.

Test mode

Activate test mode using the icon right in the main toolbar.

If the test mode is activated the canvas will turn green.

The following section explains the errors that may appear in your documents.

Invalid type

You have tried to format a variable using a renderer, but the value of the variable contains the wrong type.

If you for example have a variable ${name} that contains the value Daniel and you try to render it as a currency, you will get this error.

Invalid expression

You have typed something that Doxey cannot understand. Please read the template essentials guide carefully.

Not an array

You have tried to access an element in a list or an array, but the variable is not an array.

Let's say you have a variables called name with the value Daniel then using a tag like ${name[2]} will result in this error.

Invalid array syntax

You tried to access an array, but you got the square brackets wrong. Make sure they are in the correct order and both brackets are present.

Index out of bounds

You have tried to access an element in a list or an array, but it does not contain as many elements as you expected.

Let's say you have an array names containing two names then accessing the third one like this ${names[3]} will result in this error.

Invalid index

You are trying to access an element in an array, but you have not used a legal index.

Let's say you have an array called names with three elements Daniel, Olli and Esther then you can access them using ${names[0]} which will print Daniel, ${names[2]} which will print Esther or ${names[last]} which will also print Esther.

If you try to access them using something like ${names[end]} or ${names[hello]} will not work and cause this error.

No call on a string

You are trying to access a variable as if it would have some properties, but it is just a string. Let's say you have a variable called name with the value Daniel then accessing something like ${name.email} will cause this error.

Property access error

You are trying to access a property of an object that does not exist. There are several situations that may cause this error.

Let's say you have loaded a worksheet with several columns. Then you will have a number of variables like ${mysheet[].myfirstcolumn}, ${mysheet[].mysecondcolumn} and so on. If you are now accessing a ${mysheet[0].hello} you will end up with this error as the column with name hello does not exist.

This error can also pop up if you are trying to access a property, but not in the correct way.

If we have the same example as before and you try to access ${mysheet[].myfirstcolumn} it will you the same error as mysheet[] is a list! it is containing all rows and you are asking for myfirstcolumn without accessing a specific row or using a loop to print all values.

Unmatched end

You have used an ${end} tag in your template, but you did not create a matching ${if …} or ${foreach …} statement.

Missing end

You have used an ${if.. } or ${foreach …} statement in your template, but you did not create a matching ${end} statement.

Else out of scope

You have used an ${else} tag in your template, but it is not inside an ${if …} statement.

Foreach incomplete

You have tried to create a ${foreach... } statement but you have forgotten to specify a variable name to access each item in the list.

Iterator mismatch

You are trying to create a list or table from your data, but you accessed different lists in the same table!

Let's say you have a list of authors and a list of books.

You can now create a table displaying the authors or the books - but if you mix both you will end up with an error:

Names of the authors

Titles of the books

$[authors[].name]

$[books[].title]

Incomplete tag

You have used invalid syntax. Please read the template essentials guide carefully.

This error will show up if you have not closed all opening brackets with the matching closing brackets.

The following table shows a number of common errors.

Expression

Description

${myvariable]

You have closed the open curly bracket { with a square bracket ]

${value;number(op=${pattern)}

You have used invalid syntax in the renderer parameter. Never use open brackets to access variables in the renderer parameters. In this example just use $pattern instead

Questions and Feedback

If you have any comments on this page, feel free to add suggestions right to the Google document that we are using to create this site.

If you are not yet member of the Doxey community, please join now to get updates from our end or to provide feedback, bug reports and discuss with other users.

Last Updated: 18.11.19