Template Tags

This section describes all the template tags that can be used to author a document template. During the Document Generation Process , the Document Generation API replaces the template tags in the document template with the input data to generate the output document.

data-slots=text
All the tags are JSONata compliant.

Placeholder Variables

A placeholder(text tags) gets replaced by the actual input data.

How to insert Placeholder Variables

data-slots=text
A placeholder variable can only be applied to an input field of type string, number or boolean. <br/> Formatting applied to the placeholder variable in the document template will be retained in the output document.<br/> For more simplified styling and formatting for the placeholder tag from the input json data, please refer styling and formatting section:

JSON representation of the input data:

{
  "accountName": "Kane Miller",
  "accountNumber": "8324e015-6400",
  "address" : {
    "street": "123 ABC Street",
    "state": "LA",
    "zip": "9XXXX"
  },
  "doctor" : "John Doe"
}

Usage

Placeholder variables get replaced with the actual input data.

Placeholder tags being replaced by values

Default Value

A default value can be specified for the placeholder variable. In case the specified tag is not present in the input json data, the placeholder gets replaced with the default value.

Placeholder tags with default value set

Optional

Setting placeholder variable as optional will replace the placeholder with an empty string in case the specified variable is not present in the input data.

Placeholder tags with optional image set

Prefix

A prefix value can be specified for the placeholder variable. Doing so will append this value before the result of the tag.

Placeholder tags with prefix image set

Images

To dynamically insert an image in the document, add any image as placeholder and edit the alt text as per the defined format:

How to insert Images

{
  "location-path": "logo",
  "image-props": {
    "alt-text": "This is an alt-text for the image placeholder"
  }
}

The properties defined in the format specifies the location-path and the alt-text.

The location-path specifies the location of image in the input data.

Alternative text for the image can be provided using the alt-text property as defined in the format.

data-slots=text
The height and width of the placeholder image is retained in the output document. <br/> Supported image formats are JPEG, PNG, GIF, BMP, TIFF and SVG.

JSON representation of the input data:

Image data can be provided either in the form of the base64 encoded string or in the form of publicly accessible URLs.

{
  "logo": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAIAAACRXR/mAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAKM0lEQVRYhZVZa4xdVRX+1j7nvmY6fcy0tOC00FKgECgtFLVNBIVoCJBogj9ImviABBDEP0b9gYb6QzEoCgoqGPlBEwiJkqhVoDQmllIeVQiWVJ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9BCg0/iAXlGM9OFUKJQR/Ot0Qft/uPzuR7EJ7vQhiED36QMAhKLFfRYshsQksXzDbLIL7IvClUXwaADUUm+lELFI+NPZ1DIDk/wAgP2EeAXgCoAAAAABJRU5ErkJggg=="
}

OR

{
  "logo": "https://documentcloud.adobe.com/dc-docgen-app/assets/dc_icon.png"
}
data-slots=text
Only https image urls with an image size of less than 20 MB are allowed.

Add the image placeholder.

Initial rendering of the image tag

Add the alt text to the image as per the specified format.

Adding alternative text for the image

The image placeholder will be replaced by the image data in the output document.

Image placeholder replaced by the image data

data-slots=text
Image can also be inserted using the html <img/> tag. Please refer Inline Images to learn more about this.

Conditionals

Show or hide content in the document based on the conditions.

How to insert Conditional Tags

data-slots=text
The condition must be wrapped inside expr(). <br/> Supported conditional operators are =, !=, >=, >, <=, <.

JSON representation of the input data:

{
  "state": "CA"
}

Conditional Sections

Show or hide paragraphs based on conditions.

Showing an paragraph based on a condition

Conditional Phrases

Show or hide text inside a paragraph based on conditions.

Showing a text inside a paragraph based on a condition

Tables

Insert Table using <table> HTML Element

Add tables in the document through json data using <table> tag.

JSON representation of the input data:

{
  "Table_Data": "<table border='1' cellpadding='0' cellspacing='0' style='width:30%'><tr><th>Name</th><th>Age</th><th>Gender</th></tr><tr><td>Sheldon</td><td>29</td><td>Male</td></tr><tr><td>Leonard</td><td>30</td><td>Male</td></tr><tr><td>Howard</td><td>28</td><td>Male</td></tr><tr><td>Raj</td><td>29</td><td>Male</td></tr></table>"
}

Usage

Placeholder tag is replaced by a table generated using the html string provided in the input json. Sample for HTML Table insertion

data-slots=text
  • Placeholder Tags containing <table> HTML element as value in input json data, should be placed in a separate paragraph in the input document template.

  • Only Inline Styling of Table elements is possible. i.e. using style attribute of <table>. Internal and External styling are not allowed.

Insert Table using Placeholder Table Tag

Rows of a table can be dynamically populated by repeating over an array of objects from the input data.

How to insert Tables

data-slots=text
Formatting applied to the table in the document template will be retained in the output document.

JSON representation of the input data:

{
  "subscriptions": [
    {
      "name": "Adobe Document API",
      "price": "99",
      "quantity": "1",
      "amount": "99"
    },
    {
      "name": "Adobe Marketing API",
      "price": "199",
      "quantity": "2",
      "amount": "398"
    }
  ]
}

Usage

Create a table with requisite column headers. Add a row to the table and place the template tags referring to the properties of the objects in the array inside the row under the required column headings.

The template tag should indicate the name of the array followed by the property name of the objects in the array. {{subscriptions.name}} illustrates one such template tag where subscriptions refer to the array of objects while name refers to the property of one such object in the array.

Table created with column headers and template tags for each subsequent rows

Table rows are dynamically populated in the output document by repeating over the specified array of objects.

Table with template tags replaced with actual values in the rows

data-slots=text
Please visit Complex Table Constructs to learn about advanced constructs inside tables.

Lists

Dynamically generate numbered or bullet lists by repeating over a list.

How to insert Lists

JSON representation of the input data:

{
  "products": [
    {
      "productName": "Adobe Photoshop"
    },
    {
      "productName": "Adobe Premiere Pro"
    },
    {
      "productName": "Adobe InDesign"
    }
  ]
}

Numbered Lists

Dynamically generate a numbered list by placing it inside a repeating section.

Template tag items are replaced by numbered list

Bullet Lists

Dynamically generate a bullet list by placing it inside a repeating section.

Template tag items are replaced by bullet list

Simple Lists

JSON representation of the input data in case of simple lists:

{
  "products": ["Adobe Photoshop", "Adobe Premiere Pro", "Adobe InDesign"]
}

Dynamically generate a numbered or bullet list by placing it inside a repeating section.

Template tag items are replaced by numbered or bullet list

Numerical Calculations

Performing numerical calculations on the input data.

How to insert Numerical Calculations

All calculations supported are JSONata compliant.

data-slots=text
All the calculations must be wrapped inside expr().

JSON representation of the input data:

{
  "revenue": "1000",
  "expenditure": "650",
  "subscriptions": [
    {
      "description": "Adobe Photoshop",
      "licenses": "1"
    },
    {
      "description": "Adobe Premiere Pro",
      "licenses": "2"
    },
    {
      "description": "Adobe InDesign",
      "licenses": "1"
    }
  ]
}

Arithmetic

Performs simple arithmetic operations.

Performing simple arithmetic to show revenue-expenditure

data-slots=text
Supported arithmetic operations are +, -, *, /, % . <br/> An arithmetic numerical calculation can only be applied to input fields that corresponds to a number.

Aggregation

Performs aggregations on a list of elements.

Performing simple arithmetic to show aggregation

data-slots=text
Here is the list of supported aggregation functions <br/> An aggregate numerical calculation can only be applied to a list of numbers.

Adobe Sign

Adobe Sign text tags can be placed anywhere within the contents of the document template.

These tags are converted into Adobe Sign form fields when the final document is sent for a signature using Adobe Sign.

data-slots=text
Please visit Adobe Sign Text Tag Guide to learn about different Adobe Sign text tags.