Formatting document generated data

This document contains instructions for system administrators to execute through the Command Centre.

Formatting document generated data

If Adobe Document Generation integration has been enabled for your site, you may find that various tags relating to values are presented in a verbose format and are either not user or locale friendly.

The information below list compatible JSON expressions for common data types, formats and error handling.

Dates

Dates by default are provided using the ISO 8601 standard. Paste the below syntax into the MS Word template being used for Document generations and replace insertDate with the relevant date tag minus its parenthesis', to achieve the desired output.

Example: If the tag is {{endDate}} replace insertDate with endDate

Syntax

Output

{{$fromMillis($toMillis(insertDate), "[D01]/[M01]/[Y0001]")}}

26/09/2024

{{$fromMillis($toMillis(insertDate), " [D01] [MNn] [Y0001] ")}}

26 SEP 2024

{{$fromMillis($toMillis(insertDate), " [D01] [MN] [Y0001] ")}}

26 September 2024

Values

By default, values are rounded to one decimal place. However, for currencies, this rounding can introduce inaccuracies and may result in unfamiliar presentation. Paste the below syntax into the MS Word template being used for document generation and replace insertValue with the relevant value tag minus its parenthesis', to achieve the desired output.

Example: If the tag is {{originalValueExTax}} replace insertValue with originalValueExTax

Syntax

Output

{{$formatNumber(insertValue, '###.00')}}

699.00

3145.50

1000450.99

{{$formatNumber(insertValue, '#,###.00')}}

699.00

3,145.50

1,000,450.99

Blank Values

If an inserted tag references a blank field, the result provided will also be blank. This may give the appearance that the document generation did not execute correctly or missed data. Using the syntax below you can force more meaningful text to be displayed, such as "Not provided" so the reader has more clarity. The red text "Not provided" in the examples below can be replaced with any text you wish to display.

Example: If the tag is {{owner.emailAddress}} replace dataTag with owner.emailAddress

Tag type

Syntax

Text field

{% conditional-section expr(dataTag =null)%} Not Provided {% end-section%}{% conditional-section}

Date field

{{$.dataTag!= null ? $fromMillis($toMillis(dataTag), "[D01] [MNn] [Y0001]"): "Not Provided"}}

Value Field

{{$.dataTag!= null ? $formatNumber(dataTag, '#,###.00'): "Not Provided"}}

Was this article useful?

Creating and Managing Document Generation Templates

Contact