Client Side Template

Client-side Templating Syntax


The syntax used for client-side templates and examples. Templates can be used in Alpha Anywhere to merge JSON data into a desired format which then can be output in the form of HTML.


See Client-side Templates to learn more about using template syntax.


Escapes {} characters

{/* comment */}

Comments can be added to client-side templates using the {/* ... */} directive.


Dynamically show or hide parts of a template.


Zero-based row number for the current row.


Used to number rows.


Formats date values

<escape<{some template code}>>

Escapes long strings of template characters


Escapes HTML elements in a field.


Specifies alternative text in a template when a data value is missing.

{(logicalExpression ? trueResult : falseResult)}

An inline if-else expression for creating a dynamic template.


Formats string values to make them lowercase.


Formats numeric values

[parent] Directive

Accesses the root object


The arbitrary iterator allows you to iterate over dynamically created data.


Code to execute when {*if logicalExpression} and {*elseif logicalExpression} conditions are not met.

{*elseif logicalExpression}

Evaluates if any additional javascript expressions are true/false after a {*if logicalExpression} command executes.


Displays alternative text when an array contains no entries.


Closes a conditional command.

{*ensure var 1,var 2,var 3}

Protects the existence of data variables.


Adds a footer to a template.


Adds a header to a template.

{*if <defined<var 1,var 2>>}...{*endif}

Executes a string or some data if a variable in the data set is defined.

{*if <undefined<var 1,var 2>>}...{*endif}

Lets you append strings in the template when variables are undefined.

{*if logicalExpression}

Defines a conditional section that evaluates if a javascript expression is true/false.

{*partial partialName}

Adds partial sections of data into the template.


Allows you to use headers and footers when the JSON data being passed in is an array.


References data that has been stored in a global variable named 'temp'.


Formats string values to make them uppercase.


Loops over a JSON array and displays the element values.

See Also