# Home

### Useful Links

<table data-view="cards"><thead><tr><th></th><th data-hidden data-card-cover data-type="files"></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td>The best place to get up and running with Documint</td><td><a href="/files/0Ztk3arfp4y1k0zozl6p">/files/0Ztk3arfp4y1k0zozl6p</a></td><td><a href="/pages/bOzZwGdCszPKSAFSTKJX">/pages/bOzZwGdCszPKSAFSTKJX</a></td></tr><tr><td>Check out our video library</td><td><a href="/files/2jMsscMz0neXXQeo9eFL">/files/2jMsscMz0neXXQeo9eFL</a></td><td><a href="/pages/eukiVtok6PuckMS2J5cO">/pages/eukiVtok6PuckMS2J5cO</a></td></tr><tr><td>Learn about templates and how to use them</td><td><a href="/files/IFlpmHPRNV3hRXH6XHmt">/files/IFlpmHPRNV3hRXH6XHmt</a></td><td><a href="/pages/Hb9HKfd46jP8C5WfTIE7">/pages/Hb9HKfd46jP8C5WfTIE7</a></td></tr><tr><td>Learn how to add data dynamically to your documents with variables</td><td><a href="/files/4Zy5vebT6TXOxg3NXVLQ">/files/4Zy5vebT6TXOxg3NXVLQ</a></td><td><a href="/pages/AF6XvgPaLLwI12samEg5">/pages/AF6XvgPaLLwI12samEg5</a></td></tr></tbody></table>

### QuickStart Guides <a href="#quickstart-guides" id="quickstart-guides"></a>

<table data-view="cards"><thead><tr><th></th><th data-hidden data-card-cover data-type="files"></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td>Connect, merge and generate your first document in less then 5 minutes with Airtable</td><td><a href="/files/EuHkSUrjXVDXz5It6tgB">/files/EuHkSUrjXVDXz5It6tgB</a></td><td><a href="/pages/meh0kY2ylVV0gFUaSzKc">/pages/meh0kY2ylVV0gFUaSzKc</a></td></tr><tr><td>Coming soon...</td><td><a href="/files/sHY2t6z9ktTJqqHHFUh4">/files/sHY2t6z9ktTJqqHHFUh4</a></td><td><a href="/pages/lVzuQ74gh8eWI03o2HQO">/pages/lVzuQ74gh8eWI03o2HQO</a></td></tr><tr><td>Connect, merge and generate your first document in less then 5 minutes with Coda</td><td><a href="/files/zeou6mneaGqo2lgdVffd">/files/zeou6mneaGqo2lgdVffd</a></td><td><a href="/pages/LkJpz4qFOleGJOCMgRul">/pages/LkJpz4qFOleGJOCMgRul</a></td></tr><tr><td>Connect, merge and generate your first document in less then 5 minutes with Zapier</td><td><a href="/files/aHcU2OEzrqmFIoSVO0bR">/files/aHcU2OEzrqmFIoSVO0bR</a></td><td><a href="/pages/YXyxhENOxBZWoBCXfGR6">/pages/YXyxhENOxBZWoBCXfGR6</a></td></tr><tr><td>Connect, merge and generate your first document in less then 5 minutes with Make</td><td><a href="/files/UzGPyHl5gtkFnNNJHCma">/files/UzGPyHl5gtkFnNNJHCma</a></td><td><a href="/pages/iIyBdkMYwqLQQsTcYPWh">/pages/iIyBdkMYwqLQQsTcYPWh</a></td></tr></tbody></table>

### Integrations

<table data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-cover data-type="files"></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td>Learn how to create</td><td>documents directly from</td><td>Airtable</td><td><a href="/files/EuHkSUrjXVDXz5It6tgB">/files/EuHkSUrjXVDXz5It6tgB</a></td><td><a href="/pages/qulMrTwifFwi9UL5nT04">/pages/qulMrTwifFwi9UL5nT04</a></td></tr><tr><td>Learn how to create </td><td>documents from your </td><td>HubSpot portal </td><td><a href="/files/sHY2t6z9ktTJqqHHFUh4">/files/sHY2t6z9ktTJqqHHFUh4</a></td><td><a href="/pages/SEyjjQlShNLxxC0xHyjk">/pages/SEyjjQlShNLxxC0xHyjk</a></td></tr><tr><td>Learn how to create</td><td>documents directly from </td><td>Coda</td><td><a href="/files/zeou6mneaGqo2lgdVffd">/files/zeou6mneaGqo2lgdVffd</a></td><td><a href="/pages/Kms0PgePD28Qb1XmsiCm">/pages/Kms0PgePD28Qb1XmsiCm</a></td></tr><tr><td>Learn how to create apps </td><td>documents from 1,000s of </td><td>using Zapier </td><td><a href="/files/aHcU2OEzrqmFIoSVO0bR">/files/aHcU2OEzrqmFIoSVO0bR</a></td><td><a href="/pages/xOSPM3I6ORXrF8vjEKH1">/pages/xOSPM3I6ORXrF8vjEKH1</a></td></tr><tr><td>Learn how to create </td><td>documents from 1,000s of </td><td>apps using Make (fka Integromat)</td><td><a href="/files/UzGPyHl5gtkFnNNJHCma">/files/UzGPyHl5gtkFnNNJHCma</a></td><td><a href="/pages/9B8p1N8PK3dcjvckptqJ">/pages/9B8p1N8PK3dcjvckptqJ</a></td></tr></tbody></table>


# Welcome to Documint!

A digital instruction guide for using Documint

Documint is a web-based software tool that enables users to merge their data with templates to automatically generate PDF documents. This is useful when you need to create multiple documents that are generally the same in style and design but differ in the data they contain.

If you are new to Documint, we recommend you follow the[ guided walkthrough](/introduction/basic-tutorials/designing-a-basic-template-from-scratch) to learn the end-to-end process of designing a template, mapping variables, and merging a document. This will show you the basics of Documint in a sequential and concise manner.

The diagram below illustrates how Documint works at a basic level:

![](/files/9OgTxaIaYgAoXS6gcL9u)

\
**Templates** are blueprints for your documents. You can think of a template as a document but with fields instead of the actual data that the document will contain. When you merge your data with a template you've created a document.

\
**Tokens** are special placeholders that you add to your templates that instruct Documint where to place your data when creating a document. They are denoted by double brackets in each template.

\
**Merging** is the process of creating a document from a template with the data that Documint received from the data source

**Documents** are the result of merging data with a template. Examples of documents that can be generated with Documint include:

* Invoices
* Contracts
* Proposals
* Forms
* Quotes
* Reports
* Product Specification Sheets
* Bills of Lading, Materials, and much more…

{% hint style="info" %}
**Currently, PDFs are the only file types supported by Documint.**
{% endhint %}

### Setting up your First Documint Account

We're excited to have you on board. To create your account, head over to [documint.me](https://documint.me) and click **Sign Up**. You'll be asked to enter your full name, email address, and a secure password.

During setup, you’ll also have the option to select your industry—this step is optional but helps us tailor your experience based on your needs.

Once you’re signed in, you’ll be ready to start creating your first template. Welcome aboard!

{% embed url="<https://youtu.be/_bftfW8iV3A?si=606OTYKaMc9gu-NM>" %}


# Core Concepts

### What is a Document

This is where Documint works its magic. When your template is set up and you're ready to start creating documents you will send your data to your Documint template, then Documint will merge that data into the template thus <mark style="color:blue;">**creating a document.**</mark>

![](https://384378337-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MT1T1SjtsFgrrhbgucz%2F-MefWc0Ji3XqTszpzwbQ%2F-MefZQup0Und6ZnlZ6-e%2FMerge.png?alt=media\&token=545dcec6-1dc9-4b29-a63f-a19266d515d3)

### What are Templates and why do we need them?

If we wanted to create a static document we could do this easily by using one of the many document editor applications on the market (ie. Microsoft Word, Google Docs, etc.). But what if we wanted to create the same type of document (ie. invoice) multiple times and each time it had different information? We could create a document in a traditional document editor and manually update the contents of the document every time we needed a new version. This process is tedious, error-prone, and takes a long time. What if we automated this process? This is where templates come in.&#x20;

![](/files/qRE9AIzu6U490hAtkQuK)

Templates allow you to design your document with information placeholders called [`tokens`](/templates/working-with-dynamic-data/field-tokens#what-are-tokens). At the most basic level, `tokens` tell Documint where in the document to place your data when it is created. This, however, is just the beginning. You can also use them to conditionally show or hide content in your template and even repeat certain elements of your template based on the data being merged.

So, how do we actually create documents from our templates? The process of creating documents from your data is called "merging" and it occurs when data is sent from your data source application (ie. CRM, database, etc.) to your template. Documint receives the data and places it in the corresponding tokens that you've added to your template.&#x20;

Documents created from templates will grow or shrink to as many pages as necessary to fit its content.

### Template Gallery&#x20;

If you already have an idea of what you need a template for (ie. invoices), you can save some time by selecting one of the standard templates already provided in Documint.

For example, to get started on an invoice template, select an invoice template option on the Documint home screen.

![](/files/XDuCWJFUEeNPnM5B79wz)

###

### Getting Started with the Template Designer

To design a template from scratch, start by clicking the New Template button on the top right and selecting the blank template. The next screen is the template designer.

Unlike other document generation applications that use a word-processor style editor, Documint uses a block-style drag-and-drop editor. This gives you the most control over your template design and layout.

The <mark style="color:blue;">**template designer**</mark> is composed of three main panes:

![](/files/jq443zbLs5EzV8U9d1So)

1. On the left is the Add pane, which has Content and Layout elements you can add to the document
   * Examples of content elements include forms of information like text and images
   * Examples of layout elements include ways of organizing the template space, such as rows, and columns
   * Selecting an element will enable you to configure its properties. This pane will also appear on the left
2. At the center of the screen is the canvas, where template elements are placed according to your design
3. On the right-hand side is the Data pane, where you can link Documint to Airtable and map your fields, or build your token [schema](/templates/working-with-dynamic-data/fields-editor) using the Custom Data Source option.&#x20;


# How it Works

Welcome to Documint! We are a document generation platform that lets you generate customized PDFs (such as invoices, proposals, and certificates) using data from these tools:&#x20;

* [HubSpot](/integrations/hubspot)&#x20;
* [Airtable](/integrations/airtable)&#x20;
* [Zapier](/integrations/zapier)
* [Make.com](/integrations/make.com)
* [Coda](/integrations/coda)
* [Stacker](/integrations/stacker)
* [Noloco](/integrations/noloco)&#x20;
* [Softr](/integrations/softr)&#x20;
* [Pory](/integrations/pory)
* Or directly from your [API](https://documenter.getpostman.com/view/11741160/TVK5cLxQ)

Instead of manually editing templates every time your data changes, Documint dynamically merges your data into a pre-designed template and returns a completed PDF ready to send, store, or share.

#### How does Documint work?&#x20;

1. **Create your Template**

You start by building a template inside Documint, think of it like a design tool. You can add text, images, tables, or placeholders for dynamic fields<br>

* Add [text](/templates/document-structure-and-layout/page-elements/content-elements#text), [images](/templates/document-structure-and-layout/page-elements/content-elements#image), and other [elements](/templates/document-structure-and-layout/page-elements) to structure your document.
* Build static and dynamic [tables](/introduction/basic-tutorials/how-to-create-tables).
* Use dynamic tokens. [Tokens](/templates/working-with-dynamic-data/field-tokens) are placeholders that represent real data (like customer names, totals, or product images).
* Tokens are generated automatically from your data [schema](/templates/working-with-dynamic-data/connections#the-custom-connection), which defines what fields your data will include (e.g. `customer_name`, `invoice_total`, `items.description`).

You can also add [logic](/legacy-documentation/repeating-elements) and list items visually, for example, repeat a table row for every line item in an invoice.

<figure><img src="/files/uXPNk0WRKUJqsPAc3bCA" alt=""><figcaption></figcaption></figure>

The result is a clean, visually designed template that’s ready to be filled with live data.

2. **Connect your Data Source**

Once your template is built, you connect it to the data you want to populate it with. Documint integrates seamlessly with:

* Airtable, HubSpot, and other business tools
* Automation platforms like Zapier, Make, and n8n
* Custom APIs via JSON payloads

When you connect it to Airtable, Documint automatically maps your data fields to the tokens in your template schema.&#x20;

<figure><img src="/files/UhTJ3sp3eViI3p5R6A1G" alt=""><figcaption></figcaption></figure>

And when integrating with other data sources, just build the schema on the Custom Data Source option.

<figure><img src="/files/edLZd6cvIH7TG344vgBp" alt=""><figcaption></figcaption></figure>

You can even test your connection by loading sample records right inside the editor. Each value in your data automatically fills the corresponding token in the template at generation time.

3. **Preview the Document**

Before generating the final output, you can preview your document with real data inside the Template Designer.

The live preview feature allows you to:

* Verify that text, tables, and images render correctly
* See how tokens resolve using actual data values
* Check that your conditional sections and lists behave as expected

This step ensures your layout and logic are perfect before automating document generation.

<figure><img src="/files/flyvVDqCVEJVuM9wTcJG" alt=""><figcaption></figcaption></figure>

4. **Generate the PDF**

Once your template and data connection are ready, generating your document is simple.

You can trigger a generation:

* Using a button with a Generation Link (e.g., Airtable)
* From a workflow automation (e.g., Zapier or HubSpot workflow)
* Directly via API, by sending JSON data to your template

When the request runs, Documint:

* Replaces each token with your live data
* Renders dynamic images
* Applies logic for repeating lists or conditional sections
* Returns a completed, ready-to-share PDF file or link (we only store the PDF link for 24 hours. Uploading the PDF to a cloud is suggested)

<figure><img src="/files/SCOOCEVB4FtmbLiTv61n" alt=""><figcaption></figcaption></figure>

In summary, Documint lets you design once and automate forever. By combining a visual designer, schema-based data mapping, and dynamic token generation, you can create professional PDFs (invoices, quotes, certificates, or reports) automatically populated with your data.


# Platform Quickstart Guides

<table data-view="cards"><thead><tr><th></th><th data-hidden data-card-cover data-type="image">Cover image</th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td>Airtable Quickstart Guide</td><td data-object-fit="contain"><a href="/files/kJW9ATN8jiIHV9EB5Ng1">/files/kJW9ATN8jiIHV9EB5Ng1</a></td><td><a href="/pages/meh0kY2ylVV0gFUaSzKc">/pages/meh0kY2ylVV0gFUaSzKc</a></td></tr></tbody></table>


# Airtable Quickstart Guide

In this quick guide, you’ll learn step-by-step how to generate PDFs directly from your Airtable base using Documint!

{% embed url="<https://youtu.be/AvfFeq5KKns>" %}

{% stepper %}
{% step %}

### **Clone "Employee Salary Report" Template**

Clone the "Employee Salary Report" template into your Documint account by clicking the button below.&#x20;

<p align="center"><a href="https://app.documint.me/templates/697d02744c6b5b4bad8b3a8e/clone" class="button primary" data-icon="clone">Clone "Employee Salary Report"</a></p>

<figure><img src="/files/l6Rw21WrZp7DPI4nUmJS" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### **Clone "Free small business budget template" Base**

Clone the "[Free small business budget template](https://www.airtable.com/templates/small-business-budgeting/exp12tdSHGebHtVlN)" base template from the Airtable Marketplace to your Airtable workspace

<figure><img src="/files/DFwYJD7AafilHculbMuc" alt=""><figcaption></figcaption></figure>

<p align="center"><a href="https://www.airtable.com/templates/small-business-budgeting/exp12tdSHGebHtVlN" class="button primary" data-icon="clone">Clone Airtable Base</a></p>

Here is how you can do that:

1. Once you are redirected to Airtable's page, click `Use Template`
2. Then, select the Workspace where you want to store this base

<figure><img src="/files/kSqsgfABYO9ZRjPdrUok" alt=""><figcaption></figcaption></figure>

You have now successfully cloned the base! :tada:
{% endstep %}

{% step %}

### **Connect Airtable and Documint**

Once the base is in your workspace, it's time to connect Airtable and Documint.&#x20;

1. **Connecting your Airtable source**

On your template, you will see a source pane on the right-hand side of the builder. There, you'll see Airtable as an option to connect. Click on the connect button.

<figure><img src="/files/oEQ0LdOEnZvWSXBcuhSO" alt=""><figcaption></figcaption></figure>

2. **Sign in with Airtable**

After clicking to connect with Airtable, select the "Sign in with Airtable" option in the pop-up. You'll be redirected to your Airtable account. If you're not logged in yet, just log in, and you'll go to the OAuth page. Feel free to grant access to all resources or to specific bases

<figure><img src="/files/40qx8Fg4Fs0KyjM1wF0c" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### **Set up Airtable Connection**

In the template, go to the three dots here in Custom Data Source in the Data pane, and the Airtable option will show up for you.&#x20;

<figure><img src="/files/uhdk6KXDFTLHCfRsgf5q" alt=""><figcaption></figcaption></figure>

Select the `Small business budget` base. Then select the `Salaries` table. Select all field and that's it! The fields are all connected again.

<figure><img src="/files/oGgNgDlA7oqRUwmoLIoV" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
You can also select only the fields that are used in the template, which are: `Photo.url`,  `Role`, `2019 salary (projected)`, `Expenses.Name` and `Expenses.Cost`

<img src="/files/S3SDrRCcxv1JrR1bhyzQ" alt="" data-size="original">
{% endhint %}
{% endstep %}

{% step %}

### **Set up the attachment field**

Now, go back to the table integrated with Documint (Salaries) and create an attachment field to store the generated PDF. In this example, we've named it `PDF`. However, you can name it anything you'd like.&#x20;

<figure><img src="/files/ef3ybeP3DAjVlvvYQV52" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### **Create the Generation Link for the Documint Template**

And back to the template, go to the `Add formula` section under Sources in the Airtable connection and select the Generation Link option. Select the attachment field that you created in the previous step, then copy the `Generation Link Formula`.

<figure><img src="/files/hJMhEXRcszc6Gt2ZPdnS" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### **Create the Button field**

In Airtable, navigate to the `Salaries` table, create a new field with a type of `Button`. Give it a label, then paste the **Generation Link Formula** in the `URL formula` field and save it.

<figure><img src="/files/fzNwRrlW200lflCkCRZb" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### **Generate First Document**

Click the button and voilá! You have now created your first document, and the information in that record was merged with the template, resulting in a PDF.&#x20;

<figure><img src="/files/N60jl3NUUoKiKO5L7goT" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

Here are other ways you can integrate with Airtable:&#x20;

1. [<mark style="color:$primary;">**Automation Script**</mark>](/integrations/airtable/automation-script): Automatically sends Airtable data to Documint to generate documents based on predefined triggers and actions.
2. [<mark style="color:$primary;">**Airtable Extension**</mark>](/integrations/airtable/airtable-extension): Airtable Marketplace extension that lets you select a record and generate either a document preview or a live, unbranded document directly from Airtable.


# HubSpot Quickstart Guide

In this quick guide, you’ll learn step-by-step how to generate PDFs directly from a HubSpot contact using Documint!

### **Clone** "Certificate - HS Contact" **Template**

Clone the "Certificate - HS Contact" template into your Documint account by clicking the button below.&#x20;

<p align="center"><a href="https://app.documint.me/templates/697d2a514c6b5b4bad8bb84c/clone" class="button primary" data-icon="clone">Clone "Certificate - HS Contact"</a></p>

<figure><img src="/files/K8iwQywBzhyo4RB5VH5y" alt=""><figcaption></figcaption></figure>

{% stepper %}
{% step %}

### **Connect Documint & HubSpot**

To add Documint's app, just go here and install it.

<figure><img src="/files/qiJPeBwnR78y8yvIfjLs" alt=""><figcaption></figcaption></figure>

<p align="center"><a href="https://app.hubspot.com/marketplace/50782869/listing/documint" class="button primary" data-icon="globe-pointer">Install Documint's App</a></p>

Grant permissions and Connect App

<figure><img src="/files/5NPXrq83hpwfRUDT8NuB" alt=""><figcaption></figcaption></figure>

In Documint, go to integrations and create the API key to connect with HubSpot. Don't forget to copy it.

<figure><img src="/files/BSIlstfiooAlSR0sTkMp" alt=""><figcaption></figcaption></figure>

Back in HubSpot, go to Integrations, then Connected Apps. Go to Documint, click on General Settings, and then the Add/Edit API key button. Paste the API key in the pop-up and save it

<figure><img src="/files/iDeOXf20eqndCXFIFyUZ" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### **Launch Documint from Contacts**

Open a Sample Contact, and you'll see that the Documint app will appear here in the right pane

<figure><img src="/files/eSZrhN2MUx236Dcml3vR" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### **Select Template**

Select the template you have cloned

<figure><img src="/files/Bjyo2TG1Q0yfAAKdYnhK" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### **Generate Document**

Choose your record and preview the document

<figure><img src="/files/sRSpDMVwdd0uYj9CnWdm" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/qAlwL5mQpw5YQosTBbci" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### **Check where it's attached**

After you have checked that the information merged correctly with the template, generate the document by clicking the Generate button. It will be saved, and you can see that in Notes and also in Attachments.

<figure><img src="/files/Aq4mLZMjWWwBwH1TGLBh" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/ewEZwBuiwluqGUKerwCm" alt=""><figcaption></figcaption></figure>

And that's it, you have just generated your first document! 🎊
{% endstep %}
{% endstepper %}


# Zapier Quickstart Guide

In this quick guide, you’ll learn step-by-step how to generate PDFs directly from Zapier using Documint!

{% stepper %}
{% step %}

### **Clone "Service Request Confirmation" Template**

Clone the "Service Request Confirmation" template into your Documint account by clicking the button below.

<p align="center"><a href="https://app.documint.me/templates/697d2a744c6b5b4bad8bb8ac/clone" class="button primary" data-icon="clone">Clone "Service Request Confirmation" Template</a></p>

<figure><img src="/files/alcNOcLpqpkURZ8BaxOs" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### **Clone Form**

Clone the form below into your Google account by clicking the button below.

<p align="center"><a href="https://docs.google.com/forms/d/1-FcMidsWuCFRMFWp7zrdIPSUHa9Ccl3wc2rkMg_IdK0/copy" class="button primary" data-icon="clone">Clone "Service Request" Form</a></p>

<figure><img src="/files/Nnxg5jMXyG3qENYX8TBi" alt=""><figcaption></figcaption></figure>

Now, add some data so you can test the document generation.
{% endstep %}

{% step %}

### **Clone Zap**

Clone Zap into your Zapier account by clicking the button below.

<p align="center"><a href="https://zapier.com/shared/e9a4d71b3fd3791eaae095665c655fa3e8b45920" class="button primary" data-icon="clone">Clone "Documint Quickstart Guide" Zap</a></p>

<figure><img src="/files/n07KTh3RVEaWSS7wGGEC" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### **Setting up the trigger**

The form is now in your Google account, and we need to add it to the trigger. When you clone the Zap, we must set this up.

The Setup pop-up for the trigger will require you to connect your Google account. Once it's done, click `Continue`

<figure><img src="/files/lx6VSeIkCYw37XYoNbME" alt=""><figcaption></figcaption></figure>

Now, choose the form from the dropdown and continue

<figure><img src="/files/Lb2BO00QAtduPUYNcAtL" alt=""><figcaption></figcaption></figure>

Lastly, let's test the step with a record

<figure><img src="/files/PDpTAukbrOxS49357X4V" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### **Connect Zapier & Documint**

When setting up the action to create the document, you'll need to sign in to Documint.

When you go to Select Account, a page will show up to paste an API key.

<figure><img src="/files/VPPaxMJTkZ6I2UtbVVTV" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/tgM8d561IgDSyoqGnn9j" alt=""><figcaption></figcaption></figure>

To get the API key, go to the Integration Settings in Documint and create an API key. Don't forget to copy it.

<figure><img src="/files/mRiemSvlFi5ENOEuycy7" alt=""><figcaption></figcaption></figure>

Now, paste it in Zapier, and let's configure it

<figure><img src="/files/lUBBUhE3Zqj5vCHeUT3B" alt=""><figcaption></figcaption></figure>

In the configure step, select the template. The template fields will show up for you to relate to the question in the form.

<figure><img src="/files/Myu97lIvRgW1S0ugOQAZ" alt=""><figcaption></figcaption></figure>

With that done, let's test the step

<figure><img src="/files/VZkpL6h1VaLftYJPv870" alt=""><figcaption></figcaption></figure>

Voilá!
{% endstep %}

{% step %}

### **Generate Document**

To check the generated document, go to `Data out` and copy this URL. Open it in a new tab, and you will see the document you have just created!

<figure><img src="/files/uk8LiXHGVPsKIlx8VVNZ" alt=""><figcaption></figcaption></figure>

We suggest you add another action to the Zap to store the PDF generated. The PDF URL only lasts for a few hours. So, feel free to connect the cloud service you use, and that's it.&#x20;

You are all set! 🎉
{% endstep %}
{% endstepper %}


# Make.com Quickstart Guide

In this quick guide, you’ll learn step-by-step how to generate PDFs directly from Make.com using Documint!

{% stepper %}
{% step %}

### **Clone** "Service Request Confirmation" **Template**

Clone the "Service Request Confirmation" template into your Documint account by clicking the button below.

<p align="center"> <a href="https://app.documint.me/templates/697d2ae04c6b5b4bad8bb99a/clone" class="button primary" data-icon="clone">Copy "Service Request Confirmation" Template</a></p>

<figure><img src="/files/m1AmX4wxBOCzTQeiHO7f" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### **Clone Form**

Clone the form below into your Google account by clicking the button below.

<p align="center"><a href="https://docs.google.com/forms/d/1-FcMidsWuCFRMFWp7zrdIPSUHa9Ccl3wc2rkMg_IdK0/copy" class="button primary" data-icon="clone">Clone "Service Request" Form</a></p>

<figure><img src="/files/Nnxg5jMXyG3qENYX8TBi" alt=""><figcaption></figcaption></figure>

Now, add some data so you can test the document generation.
{% endstep %}

{% step %}

### **Clone Scenario**

Clone scenario into your Make account by clicking the button below.

<p align="center"><a href="https://us2.make.com/public/shared-scenario/eSk7tbrvu0M/documint-quick-start-guide" class="button primary" data-icon="clone">Clone "Documint - QuickStart Guide" Scenario</a></p>

<figure><img src="/files/dsUVXNoCYhmCseXHy36m" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### **Setting up the Form module**

The form is now in your Google account, and we need to add it to the Google Form module. When you clone the Scenario, this must be set up.

First, you'll need to connect your Google account.

<figure><img src="/files/ykATdmWfkqiI8zOAf5Qi" alt=""><figcaption></figcaption></figure>

Now, choose the spreadsheet created from the form and select the sheet where the data is.

<figure><img src="/files/AV8QiBwn6GhpltFZWsN6" alt=""><figcaption></figcaption></figure>

And enter 1 for the Limit so we work with one response at a time. And save it.

<figure><img src="/files/U2KIZdZ1hLCqUBbWPoli" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### **Connect Make.com & Documint**

When setting up the Documint module to create the document, you'll need to sign in to Documint.

Once you select the connection, a field will show up to paste an API key.

<figure><img src="/files/SasFgKAFiZ6mDc2Bcdcx" alt=""><figcaption></figcaption></figure>

To get the API key, go to the Integration Settings in Documint and create an API key. Don't forget to copy it.

<figure><img src="/files/MPmIWPQUN4fBkaiqxqaM" alt=""><figcaption></figcaption></figure>

Now, paste it in Make.com, and let's configure it

<figure><img src="/files/MHg56zx5H64HLvJV7WcT" alt=""><figcaption></figcaption></figure>

Select the template and the template fields will show up for you to relate to the field in the spreadsheet. Don't forget to save.

<figure><img src="/files/QUxA4fRqf9bjyhiqf60E" alt=""><figcaption></figcaption></figure>

Lastly, connect your account to the Google Drive module so you can upload your PDF to the cloud

<figure><img src="/files/KDMyR8IjFqEVbG8RGw3U" alt=""><figcaption></figcaption></figure>

Then enter the information of where it should be stored in the drive

<figure><img src="/files/R0ttreNa9ZCgKUKC8C4n" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### **Generate Document**

Now, let's Run once and generate the first document!

<figure><img src="/files/QpmLBQrrUHuOnktL2cAK" alt=""><figcaption></figcaption></figure>

You are all set! :tada:
{% endstep %}
{% endstepper %}


# Coda Quickstart Guide

In this quick guide, you’ll learn step-by-step how to generate PDFs directly from Coda using Documint!

{% stepper %}
{% step %}

### Clone "Event Ticket" Template

Clone the "Event Ticket" template into your Documint account by clicking the button below.

<p align="center"><a href="https://app.documint.me/templates/698f8a2064a6305b0c824bd5/clone" class="button primary" data-icon="clone">Clone "Event Ticket" Template</a></p>

<figure><img src="/files/3wUgFL0obvOPfbvXvDuf" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Clone "Event Registrations" Base

Clone the "Event Registrations" base to your Coda account.

<p align="center"><a href="https://coda.io/d/_d2FwmR1MudA/Event-Registrations_suwN44XL" class="button primary" data-icon="clone">Clone "Event Registrations" Base</a></p>

<figure><img src="/files/7sXE9piwcfqqKqOyCnsn" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}


# Basic Tutorials


# Enable Multi-Factor Authentication (MFA)

If your business requires **Multi-Factor Authentication (MFA)**, you can enable it from your account settings.

{% stepper %}
{% step %}

### Open your account settings

Go to **Account Settings** and locate the **Security** section. Click **Enable MFA** and enter your account password to begin the setup.

<figure><img src="/files/bjfbF3OstuDE0fdf8wKy" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Connect your authenticator app

Scan the **QR code** using your preferred authenticator app. Then, enter the **6-digit verification code** generated by the app.

<figure><img src="/files/APfMMvrPiNEvF3Jxl2p7" alt=""><figcaption></figcaption></figure>

If you can't scan the QR code, **click the option** below it to display a setup key. Copy the key and enter it manually into your authenticator app.&#x20;

In the app, add the required information, save it, and enter the **6-digit verification code** generated by the app.

<figure><img src="/files/bHDM9hO809LC9eMcj9db" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Save your backup codes

Once MFA is enabled, you'll receive **10 backup codes**. Make sure to store these codes somewhere safe. You'll need them to access your account if you can't use your authenticator app.

<figure><img src="/files/YVrkfPwghAN52UId37N2" alt=""><figcaption></figcaption></figure>

Once it's stored, check the box confirming that the backup codes are stored and click **Done**.
{% endstep %}

{% step %}

### You're all set! :tada:

That's it! **Multi-Factor Authentication is now enabled** on your account.

<figure><img src="/files/jIZyyX1QnKN33JPQoaOH" alt="" width="375"><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}


# Designing a Basic Template from Scratch

To design a template from scratch, start by clicking the New Template button on the top right and selecting the blank template. The next screen is the template designer.

<figure><img src="/files/Vla0rS1GpfertwmCo3cd" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/v5l0zf2GZvTa7NT4uHSb" alt=""><figcaption></figcaption></figure>

Unlike other document generation applications that use a word-processor style editor, Documint uses a block-style drag-and-drop editor. This gives you the most control over your template design and layout.

The template designer is composed of three main panes:

![](/files/jq443zbLs5EzV8U9d1So)

1. On the left is the Add pane, which has Content and Layout elements you can add to the document
   * Examples of content elements include forms of information like text and images
   * Examples of layout elements include ways of organizing the template space, such as rows and columns
   * Selecting an element will enable you to configure its properties. This pane will also appear on the left

<figure><img src="/files/WCMNJU27xmFlorHdMRT1" alt=""><figcaption></figcaption></figure>

2. At the center of the screen is the canvas, where template elements are placed according to your design
3. On the right-hand side is the Data pane, where you can link Documint to other services through [Airtable Connection](/templates/working-with-dynamic-data/connections/airtable-connection) or [Custom Connection](/templates/working-with-dynamic-data/connections#the-custom-connection) (integration with apps other than Airtable), and manage data placeholders called tokens.

### Getting Started

To get an idea of how elements work at a basic level, we’ll build a super-minimal name and date template. More advanced layout instructions are located in the rest of the \[Design/Layout] section.

You’ll notice the template name ‘Blank’ on the top left of the screen. Click the text to edit it and type in a new name to describe this template such as ‘Account Note.’

![](/files/TzhhQv6FMs8zc3nZvwGg)

If starting from a blank template, simply add any layout or content element. All elements can be placed directly onto the template's body. You can insert the first element by dragging it from either the Content panel or the Layout panel onto the template. The row serves as the container that holds all the elements together.&#x20;

![](/files/9uMytg4mD4s8HLE3FVNp)

Let’s begin with just a name and date at the top of the page. Drag two text elements into the two columns in the first row that were created in the preceding step.

![](/files/3K9HrabftSdwbdrWwHar)

The left one will be the account name. Double-click the text element and type a label “Account Name: ” in the text field. Do the same for the right one, but for the date instead, typing “Date: ” in the text field.

To populate these fields with different account names and different dates, we’ll use tokens. [Tokens](/templates/working-with-dynamic-data/field-tokens) are placeholders that can change the value for each document depending on the data that is given as input. For example, if you are merging multiple documents from a list of accounts in a table, the ‘name’ token can serve as the placeholder for different account names in each generated document.

Let’s use the ‘Custom Data Source’ button on the right-hand Data pane. In the window that appears, type ‘Account Name’ as the Field name. Same for 'Note Date'. Select the Field type for each one and save it.

![](/files/2K9HWMlirilPKn59vcV0)

Drag the 'Account Name' token and drop it after the Account Name label you typed. Then, do the same exact procedure with the date token called 'Note Date'. You can confirm the created tokens by seeing them on the right-hand Data pane.

![](/files/ZOgYMa3BPzv6LlwlBeFJ)

To build out the rest of the document template, you can either add more columns to the existing row, or you can add more rows. Let’s add a second row that contains a single column for notes. To do this, drag a row element under the existing one and a column element into it.

![](/files/YALB49BSZyrxs1L0p4EN)

Like before, drag a text element into that column to create a text box that extends across the entire page. Then, double-click the text element and type 'Notes: '. And add a 'Note' field to the schema to create a third token.

![](/files/YupgFqa5xWiDYo553cfm)

### Formatting Text

Let’s format this text to be a bit different from the rest. Click on the text element in the left-hand Properties pane, and navigate to the Text section to modify the properties of the text field, such as font and alignment. You can experiment with different fonts. Here, we selected the Montserrat font, with a bold weight, and font size of 20px. Then we set the alignment to be center-aligned.&#x20;

![](/files/4GNy2rS22gIaII6UhmKY)

#### Rich Text Editor

It is also possible to bold part of the text by double-clicking on the text element. This will open an editor at the top of the template designer. Simply select the portion of the text you want to bold and apply the formatting. The same goes for other formatting options.&#x20;

<figure><img src="/files/XWsCDFr6pOkFvlrd3Muy" alt=""><figcaption></figcaption></figure>

#### Google Fonts

For fonts, you can also use a Google Font. Simply select 'More Google Fonts' and choose/search the one you would like to use.

<figure><img src="/files/WSLTTMsH5KuOJJxtoiaO" alt=""><figcaption></figcaption></figure>

### Preview Mode

Finally, let’s test this basic template out by using the preview mode. Preview mode allows you to type in your own input values for the variables in the document and see how they would look in a final merged document. Click the Preview button above the template designer.

![](/files/Xstvb4BIR7CTAwBcMdSe)

Then, enter some test values into the three variable fields and click ‘Save & refresh’ to see how the document turns out.

![](/files/H7WvspTS7FDIyhOaTYCw)

You can tell the template works properly because the values entered on the left appear on the right, exactly where and how we would expect them to.

## Creating your First Template: Step-by-Step

With the new Documint Template Designer, building a template is simpler and more flexible than ever. Here’s how to get started:

1. **Create a New Template**\
   From your dashboard, click **“New Template”**. Choose a name, connect to [Airtable](/templates/working-with-dynamic-data/connections/airtable-connection) or build your [Custom Connection](/templates/working-with-dynamic-data/connections#the-custom-connection), and select the desired page format.
2. **Design Your Layout**\
   Use the drag-and-drop interface to add layout elements such as rows and columns. You can nest elements to structure your content exactly how you want it.
3. **Add Layout and Content Elements**\
   Populate your layout using content elements like Text, Images, Tables, Buttons, QR Codes, Barcodes, and more. Each element has a properties panel where you can style and bind it to your data fields.
4. **Use Dynamic Fields**\
   Insert dynamic data using field tokens from your connected base.&#x20;
5. **Customize with Display Rules & Styling**\
   Add conditional display rules, customize fonts, spacing, alignment, and colors to match your brand.
6. **Preview and Test**\
   Click **Preview** to test your template with real data using Airtable Connection. Make adjustments as needed before publishing.

Once your template is ready, you're all set to start generating documents!

{% embed url="<https://youtu.be/I1lhubKGXko?si=Sq5vkAKosGXjhgov>" %}


# How to create Tables

Designing tables in Documint is relatively simple, but here are some tips for the best ways to get great-looking, well-aligned tables in your documents.

{% embed url="<https://youtu.be/K9_SuAp-sBM>" %}

When designing a table, whether static or dynamic, there are some things to consider. The image below shows the structure you should try to follow when creating your tables for the best results.

<figure><img src="/files/MOWL75dzr06ANHFa6gRE" alt=""><figcaption></figcaption></figure>

To ensure that your data all lines up and avoid any misalignment that might happen if data is missing, you should ensure that you arrange the line items of your tables in rows, then add columns inside each row. This will ensure everything stays locked to the row it relates to. Below are some walk-through examples of how to create both static and dynamic tables.

### Static Tables

A static table is a table whose number of rows and columns does not change.&#x20;

<figure><img src="/files/TklGjmd07R9h47MtjRNr" alt=""><figcaption></figcaption></figure>

### How to create a static table

1. Add your header row
2. Add more columns to that row, if needed
3. Add your static text and style as you would like for font, colour, borders and corners
4. Add another row for the data
5. Add more columns to that row, if needed
6. Add your static text, style as you would like for font, colour, borders and corners
7. Copy your first data row to quickly add as many rows as you need and adjust the static text

### Dynamic Tables

A dynamic table is a table whose number of rows or columns changes based on the data merged with the template. A common example of this is a line items list in an invoice.

<figure><img src="/files/gecCG2C3W7oITNznIjTW" alt=""><figcaption></figcaption></figure>

### How to create a dynamic table

1. Add your header row
2. Add more columns to that row, if needed
3. Add your static text and [Tokens](/templates/working-with-dynamic-data/field-tokens) (or [{{variables}}](/legacy-documentation/adding-variables) if you are using legacy) and style as you would like for font, colour, borders, and corners.
4. Add another row for the data
5. Add columns to that row
6. Add your static text and [Tokens](/templates/working-with-dynamic-data/field-tokens) (or [{{variables}}](/legacy-documentation/adding-variables) if you are using legacy), style as you would like for font, colour, borders, and corners
7. Add [repeating/looping](/legacy-documentation/repeating-elements) to this row so that Documint will then create as many line items as you need in the table, based on the amount of data that there is in the output
8. Set this data row to 'Avoid page breaks' to ensure your line items flow nicely onto the next page if necessary

#### Example of how your dynamic table will look in the template designer

<figure><img src="/files/D1X2Itd5XgkiiXe1hYbS" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
NOTE: Normally, dynamic tables will only have a header and a single row for your data, set in the template. The single data row is then looped over to create a dynamic table with as many line items appearing in the output as required. However, if there is a large list to display and it flows to the following page, it's not possible to repeate the table header for each page. Learn more about looping [here](/templates/document-structure-and-layout/page-elements/repeat-loop#creating-repeating-elements)
{% endhint %}


# Preview Document

### Introduction to Preview Mode

The "Preview" tab allows you to test your template using real or sample data—helping you validate formatting, conditions, and logic before publishing or exporting.

<figure><img src="/files/R5anFpvQazTUaqMC9hRM" alt=""><figcaption></figcaption></figure>

### Using the Preview Feature with Airtable Data

This option is available if you're using the [Airtable Connection](/templates/working-with-dynamic-data/connections/airtable-connection). This mode simulates rendering your template with live Airtable data without making any actual updates to Airtable itself:

1. Click the "Preview" tab in the top navigation bar.
2. Under Test Data, select "Airtable".
3. Your fields will populate based on that table’s structure and linked records.
4. You can test multiple records to test looping, conditionals, and formatting across a variety of data using the records dropdown.

<figure><img src="/files/pgDfNB8sO5IzSTGsRnO7" alt=""><figcaption></figcaption></figure>

### Using the Preview Feature with Manual Data

When using Manual mode in the Preview tab, the system will auto-generate a form based on your schema.

* Form Fields: Are dynamically created from the structure of your schema—each field corresponds to a key in your data model.
* Data Types: Are automatically inferred from the schema (e.g., strings, numbers, booleans, lists), so the form uses appropriate input types like number fields, or text inputs.
* You can override or populate only specific fields to test conditional rendering, visibility logic, loops, and more.

This allows for quick and intuitive testing without writing raw JSON, while still giving you full control over the preview data.

<figure><img src="/files/Gq5D00wo7LWB70nurL13" alt=""><figcaption></figcaption></figure>

### Toggling Between Design and Preview Modes

* Use the Design tab to build and structure your document.
* Use the Preview tab to see how it renders with actual data.
* Switch back and forth at any time—changes in the design are immediately reflected in the preview.

This workflow helps you refine structure and logic iteratively before deploying.

<figure><img src="/files/Zvjv1CNxWQcYBABoiFTO" alt=""><figcaption></figcaption></figure>

### Testing Conditional Logic in Preview

* Any logic you’ve set in the Conditions Editor or Repeat/Loop tab will be evaluated in real time during preview.
* Examples:

  * Fields that should be hidden if values are missing

  * Loops that only render if a list has items

  * Different layouts are shown for different roles or statuses

  > Tip: Test using data variations (e.g., with/without optional fields) .

In the next section, we’ll explore some tips and best practices to help you design efficient, scalable, and maintainable templates.


# Generating your First Document

Instruction page to walk you through connecting your data and generating your first merged document.

Once your template is created, tokens added, and the preview validated, you are ready to generate your first document in Documint. A *document* is the final output produced when your template is merged with real data, resulting in a PDF.

### Understanding what you will generate

When generating a document, Documint will

1. Take your template
2. Merge it with your datasource
3. Produce a final PDF

<figure><img src="/files/TL43HJqZRFp37H8kA4wA" alt=""><figcaption></figcaption></figure>

### Connect your Datasource

With the template ready, the next step is to send the data that should populate it. Documint supports multiple native integrations, allowing you to pull data directly from platforms without writing code or via API.

#### **How to Connect a Datasource (Dashboard)**

1. Open your template.
2. Go to the Integrations page
3. Select one of the available integrations (Airtable, HubSpot, Zapier, Make).
4. Follow the Setup Instructions.

<figure><img src="/files/Yh8fWq1hC0VAFbdpVwGM" alt=""><figcaption></figcaption></figure>

### Generate the PDF

You can trigger document generation directly from your connected platform:

* **From Airtable** — Add a button field or automation that sends a record to Documint to produce a PDF.
* **From HubSpot** — Use workflows to automatically create documents when a deal or contact reaches a specific stage.
* **From Zapier** — Add the “Generate Document” action in a Zap to automatically create PDFs from the connected app.
* **From Make (Integromat)** — Include Documint’s “Generate Document” module in your scenario and pass structured data.

These options let you produce documents automatically as part of your workflow.

<figure><img src="/files/NikYORPT4vVWcN1cSDWt" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
You can generate PDFs from an inactive template for testing purposes. These test documents include Documint branding at the bottom and do not count toward your usage quota.
{% endhint %}

Now that you’ve produced your first PDF, you’ve unlocked the core power of Documint: transforming structured data into polished, reliable documents. From here, you can start automating your workflows, connecting more platforms, and generating documents exactly when your business needs them.


# Template Designer v2 (Beta)

### Overview

Welcome to the latest version of our Template Designer! Whether you're a longtime Documint user or just getting started, you'll find our newest updates make creating professional documents easier than ever.

We've transformed how you add and manage the dynamic parts of your templates. Our focus has been on making variable insertion and data management intuitive and visual, eliminating the need for technical syntax while expanding the power available to you.

### What's New?

Our beta release introduces several key improvements:

* **Data Source Connections:** Import your data source fields directly into the template editor for quick drag-and-drop functionality.
* **Visual Field Editor**: Simple and intuitive interface for defining your fields.
* **Drag-and-Drop Tokens**: Insert dynamic content with simple drag-and-drop actions instead of typing code.
* **Smart Context Awareness**: Tokens automatically understand their location in your document.
* **Live Data Preview**: Test your templates with real data.
* **Enhanced Formatting Controls**: Format dates, numbers, and text directly through an intuitive interface.
* **Improved Conditional Logic**: Show or hide elements based on data with our new visual condition builder.
* **Better List Management**: Filter repeated items with our redesigned list controls.

### Why These Changes Matter

We've observed that traditional template systems with coding syntax like `{{ variable_name }}` create unnecessary complexity. Many of our users have brilliant ideas for their documents but don't have coding experience. Our mission is to remove these technical barriers while maintaining all the power and flexibility you need.

With our new visual approach, you can focus on designing beautiful, data-driven documents rather than troubleshooting syntax. The Template Designer now truly delivers on our promise of a no-code document generation solution.

### For Existing Users

If you're familiar with our previous version, you'll notice we've replaced the Handlebars curly bracket syntax with visual tokens. Don't worry! The variables on handlebars syntax are still fully supported. All your existing templates will continue to work. The new system offers the same capabilities you're used to, but with a more intuitive interface.

### For New Users

Welcome to Documint! You've joined us at an exciting time. Our Template Designer lets you create professional, data-driven documents without any coding knowledge. If you can use Google Docs or Airtable, you already have all the skills you need to create powerful document templates.

In the following sections, we'll explore each new feature in detail, with step-by-step instructions and visual examples to guide you through creating your perfect templates.


# Document Structure &  Layout

<table data-view="cards"><thead><tr><th align="center"></th><th data-hidden data-card-cover data-type="image">Cover image</th><th data-hidden data-type="content-ref"></th></tr></thead><tbody><tr><td align="center"><strong>Settings</strong></td><td><a href="/files/6U1SAUlbnw26Yj2Q6SNk">/files/6U1SAUlbnw26Yj2Q6SNk</a></td><td><a href="/pages/7XqxbsDpHx5kEXTwXfb7">/pages/7XqxbsDpHx5kEXTwXfb7</a></td></tr><tr><td align="center"><strong>Headers &#x26; Footers</strong></td><td><a href="/files/lAqma98gaY4uFS5Civr4">/files/lAqma98gaY4uFS5Civr4</a></td><td><a href="/pages/nXvcWprGr2YoYXBFgY1T">/pages/nXvcWprGr2YoYXBFgY1T</a></td></tr><tr><td align="center"><strong>Page Elements</strong></td><td><a href="/files/jfRiLD99GX3olg7PpWv4">/files/jfRiLD99GX3olg7PpWv4</a></td><td><a href="/pages/0dLie0154HwLsn0SeoWf">/pages/0dLie0154HwLsn0SeoWf</a></td></tr></tbody></table>


# Settings

Configure your template's settings

{% embed url="<https://youtu.be/kFb4hmu6ZIg?si=2gA8v4YU8CDxyQs5>" %}

You can edit your template's settings by clicking on the cog icon in the top right of the template builder page. This will open a pop-over menu with options for configuring page settings such as document naming, margins, page format, etc.

<figure><img src="/files/wWWGsmnKQYHQx6D2uxWX" alt=""><figcaption><p>Open the settings menu</p></figcaption></figure>

<figure><img src="/files/Ld3OJSZpdSTNjOVkGv65" alt=""><figcaption></figcaption></figure>

## Document Naming

You can customize the name of your documents by entering a name pattern in the template settings. Add variables to the name pattern to make each document name unique. Variables can be used in your document name pattern the same way they are used within Text elements in templates.

### Tokens

```handlebars
{{[!-- Place this in the name field --]}}
Invoice {{[Invoice Number]}} 
```

<figure><img src="/files/oQjxZAsrdApCWw4M25b2" alt=""><figcaption></figcaption></figure>

### Variables (deprecated)&#x20;

```handlebars
{{!-- Place this in the name field --}}
Invoice {{invoice_number}} 
```

<figure><img src="/files/G6npH0QdZbIMHaCSdGlp" alt=""><figcaption></figcaption></figure>

## Sizing/Format

You can select the margin sizes, page orientation (portrait or landscape), and page formatting for your template. The default page size is "Letter" (8.5 x 11 inches), but you can select from 7 standard formats.

* Letter
* Legal
* Tabloid
* A3
* A4
* A5
* A6

<figure><img src="/files/ZemUwvsbRUyh3ayQ68vr" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/BVRMH3gASLDB673TARTW" alt=""><figcaption></figcaption></figure>

If those sizes don't meet your requirements, you can define your own custom size by selecting the "Custom" format.

<figure><img src="/files/0DhBRlTzWTWsLT6YzPIq" alt=""><figcaption></figcaption></figure>

## Margins

Page margins are applied to each individual page in a document.

<figure><img src="/files/fdiYCY7vet4ouhs7hfS6" alt=""><figcaption></figcaption></figure>

## Render Engine Version

The render engine builds out your template for preview and storage.&#x20;

There are currently two render engine versions. By default, your template uses v2, and it is the engine we recommend using. However, if something in your template is not working as expected, you can try reverting to render engine v1 (we still recommend reporting the issue to documint support via the chat feature in the app or via [email](mailto:support@documint.me)).

<figure><img src="/files/kEKvEdVU2bCwYjAy3bmN" alt=""><figcaption></figcaption></figure>


# Headers & Footers

Page headers are applied to the top and bottom margins of each page.

![](/files/b5lJWAJM0bEBHkK8BaOV)

### Edit Page Headers & Footers

To edit page **headers**, click "Edit Headers" at the top of the template body.

<figure><img src="/files/lVE1v0X6iSOs1xF3UbY1" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/VmVPlMTwVJ87OwoYwGBf" alt=""><figcaption></figcaption></figure>

And to edit page **footers**, click "Edit Footers" at the bottom of the template body.

<figure><img src="/files/YZte7B1OKN1jbzatCOsO" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/a0ulhfKIqCEh9R7og3sO" alt=""><figcaption></figcaption></figure>

### Aligning Content

We recommend using a table to control the layout and alignment of content in your header/footer. This allows you to control the vertical and horizontal alignment of your content.

{% embed url="<https://youtu.be/JEU6HxRJ4U4?si=rORWF79FRwrM6g3d>" %}

<figure><img src="/files/y6IfNLUpgjqXrpSQzS8F" alt=""><figcaption></figcaption></figure>

![](/files/iGroOHbNepfenVqWNwoW)

![](/files/Cy4I5HkCpM9Har1oE9Uo)

### Variables

You can add variables to headers and footers the same way as the template body.

![](/files/lF0EKw4dXaEVBesiypJq)

{% embed url="<https://youtu.be/lI_WEB3LUDU?si=b5Nrj5q0g842o9sz>" %}

### Tokens

If you are using tokens, it's also possible to add dynamic value from a them. The syntax is similar to the variable format. Say you have this token **`Company Name`**, the variable you can add to the header/footer would look like this **`{{[Company Name]}}`**.

<figure><img src="/files/cfr5Xt9DwDdK8tZbENsW" alt=""><figcaption></figcaption></figure>

### Page Numbers

To add page numbers, you will first need to add an HTML element to the header or footer, then add  `<span class="pageNumber"></span>` for the current page number or `<span class="totalPages"></span>` for the total number of pages.

{% embed url="<https://www.youtube.com/watch?index=18&list=PLYXyDMkKKoW1F5-4pUgq9GDwECBqMTzdw&v=q0FwS1nPKN4>" %}

{% hint style="info" %}
To align text, add the HTML element in a table and edit the table and cell properties to the desired outcome.&#x20;
{% endhint %}

![](/files/GU6SZ65vGN7wJ326qD5y)

![](/files/AySmFhkmDbWmpMazW6Re)

![](/files/uVQuJRYehjdqZhRNAGSH)


# Page Elements

Page elements are the building blocks of your template. They're used to add content and structure the layout of that content.

There are 2 different types of elements:

<mark style="color:blue;">**Layout Elements**</mark> - used for controlling the structure of your template

<mark style="color:blue;">**Content Elements**</mark> - used for adding text, images, and spacing

<mark style="color:blue;">**E-signature Elements**</mark> - placeholders to e-sign

{% content-ref url="/pages/QCto3Dn3Dh7FIznBoyDg" %}
[Layout Elements](/templates/document-structure-and-layout/page-elements/layout-elements)
{% endcontent-ref %}

{% content-ref url="/pages/WFgOhdrINmaCUZemV5xm" %}
[Content Elements](/templates/document-structure-and-layout/page-elements/content-elements)
{% endcontent-ref %}

{% content-ref url="/pages/LZM0WMSl0JNdfUsaICqP" %}
[Documint Sign](/e-signatures/documint-sign)
{% endcontent-ref %}

{% content-ref url="/pages/hPmVOEywnc5tWcPF41Cw" %}
[Display Rule](/legacy-documentation/display-rule)
{% endcontent-ref %}

{% content-ref url="/pages/sWxm8TlQuk44Nd3VVvTO" %}
[Repeat/Loop](/templates/document-structure-and-layout/page-elements/repeat-loop)
{% endcontent-ref %}


# Layout Elements

### Layout Elements&#x20;

You can place any layout element onto your designer canvas to get started. Here's a run-through of each element and how they work to contain your content. Once you have placed your element you control the properties of the element to adjust things like size, space, font, etc.

### Column

Columns are used for grouping content vertically. Just drag and drop it onto your canvas.

<div align="left"><figure><img src="/files/Qfu5DSFEOHrwp7HDOPYL" alt=""><figcaption></figcaption></figure></div>

<figure><img src="/files/HTXUMrXB26imjejdI1yP" alt=""><figcaption></figcaption></figure>

{% embed url="<https://www.youtube.com/watch?index=4&list=PLYXyDMkKKoW1F5-4pUgq9GDwECBqMTzdw&v=vET5ijDlDXY>" %}

### Row

Rows are used for grouping content horizontally. Just drag and drop it onto your canvas.

<div align="left"><figure><img src="/files/twYpagfhROZHCVQUIc2S" alt=""><figcaption></figcaption></figure></div>

<figure><img src="/files/7nAqp4dt0rXqyUt8BZpj" alt=""><figcaption></figcaption></figure>

{% embed url="<https://www.youtube.com/watch?index=3&list=PLYXyDMkKKoW1F5-4pUgq9GDwECBqMTzdw&v=4d7o4Nwt53U>" %}

### Prespaced Row and Column element

You can also choose to add a pre-spaced element that is made up of rows and columns to speed up your build. You can then add additional elements if you wish to. Just drag and drop it onto your canvas.

<div align="left"><figure><img src="/files/Gr0k0Z3yNL6PcaSGoyil" alt=""><figcaption></figcaption></figure></div>

<figure><img src="/files/5Cgazmyr3Llo6vSnP2yz" alt=""><figcaption></figcaption></figure>

{% embed url="<https://www.youtube.com/watch?index=5&list=PLYXyDMkKKoW1F5-4pUgq9GDwECBqMTzdw&v=zZoQTrN8yCw>" %}

### Properties

Once you have placed your element, you control the properties of the element to adjust things like size, space, font, etc.

<figure><img src="/files/cKnVRTsJMULvmRMs32VD" alt=""><figcaption></figcaption></figure>


# Content Elements

Content elements are used for adding text, images, and spacing to your templates.

### Content Elements

You can place any content element onto your template builder to get started. Here's a run-through of a few elements and how they work. Once you have placed your element, you control the properties of the element to adjust things like size, space, font, etc.

<figure><img src="/files/r7MFM8TmJhvn7ESb5lfM" alt=""><figcaption></figcaption></figure>

### Text

Text elements allow you to add text content to your templates. Just drag and drop it onto your template builder to get started.

<div align="left"><figure><img src="/files/amy5QiBcz0jSHic3wG1R" alt="" width="161"><figcaption></figcaption></figure></div>

{% embed url="<https://youtu.be/iHqu55yLBPk?si=YI8RStevaHc7JHQQ>" %}

We now have a rich text editor! This powerful tool offers a variety of features for formatting your content, such as different styles, font sizes, bullet points, and numbered lists. You can also paste rich text from other sources while maintaining its original formatting. Dive in and explore the exciting possibilities!

<figure><img src="/files/gclVNnYxZWgS1LJi9d2n" alt=""><figcaption></figcaption></figure>

We currently offer the following fonts:

<table data-header-hidden data-full-width="false"><thead><tr><th></th><th></th><th></th><th></th></tr></thead><tbody><tr><td>Arial</td><td>Arial Black</td><td>Brush Script MT</td><td>Comic Sans MS</td></tr><tr><td>Courier New</td><td>Courier Prime</td><td>Dancing Script</td><td>Georgia</td></tr><tr><td>Helvetica</td><td>Impact</td><td>Inter</td><td>Lato</td></tr><tr><td>Lucida Sans Unicode</td><td>Nunito</td><td>Montserrat</td><td>Open Sans</td></tr><tr><td>Playfair Display</td><td>PT Sans</td><td>PT Serif</td><td>Quicksand</td></tr><tr><td>Roboto</td><td>Sans Serif</td><td>Source Sans Pro</td><td>Tahoma</td></tr><tr><td>Times New Roman</td><td>Trebuchet MS</td><td>Verdana</td><td>Noto Sans Korean</td></tr></tbody></table>

And you can also pick one of the almost 2000 Google Fonts available.

### Google Fonts

Documint provides native support for a wide range of Google Fonts, giving you flexibility to style your templates with clean, modern typography.&#x20;

To apply a Google Font:

1. Select the element you want to style.
2. Open the properties panel.
3. In the **Font** dropdown, click **More Google Fonts…**
4. Use the popup search to find and select the font that best fits your design.

<figure><img src="/files/SYKmNOZFy5iqCPlvcICi" alt=""><figcaption></figcaption></figure>

### Image

Image elements allow you to add images to your template. Just drag and drop it onto your canvas.

<div align="left"><img src="/files/GdrRqelcEKdPmu40biGy" alt="" width="160"></div>

{% embed url="<https://youtu.be/boz7ckcisBI?si=5iTwpUPf5_3unXnk>" %}

You can add images from 3 sources:

1. Local file  (from your computer)&#x20;
2. URL
3. Dynamic

#### 1. Local file

<figure><img src="/files/mhCJABlWHcMi6UcwIJkm" alt=""><figcaption></figcaption></figure>

#### 2. URL

![](/files/yMm6IFUJX5HquNo53t5j)

#### 3. Dynamic

![](/files/KmVShHDN0oifgGZ6r8ig)

### Vertical Spacer

Spacer elements allow you to add vertical space between elements

<div align="left"><img src="/files/ZYguMjMX7aqPEyxRcOzv" alt="" width="160"></div>

{% embed url="<https://youtu.be/oF2ddcFPQjk?si=0QrNvIWHWu5KxoeH>" %}

![](/files/6Zivux5qoUD9yYM0Fjqc)

### Page Break

Page breaks allow you to force the content that follows to begin on a new page

<div align="left"><img src="/files/1ZrmQQmo1zmdpQmpMmKV" alt="" width="161"></div>

{% embed url="<https://youtu.be/M7MZoNCII7s?si=x3skF5eEL60DsmW2>" %}

![](/files/uHOlYBevWuuSVngIJHA8)

### Checkbox

<div align="left"><figure><img src="/files/DLuIzJ7iW2pgg3rm9NwZ" alt="" width="161"><figcaption></figcaption></figure></div>

{% embed url="<https://youtu.be/oYAFaWZhc_8?si=LjyYrtc9w57kr0Ci>" %}

The checkbox element allows you to add and dynamically control whether it's checked or not from your data. It can be a static or dynamic element.

You may set the checkbox label, position, size, and color of the text as you wish in the properties.

To set your checkbox dynamically, you can set a field and a value, like so

<figure><img src="/files/32O6kiSzrzsvuIqAxheL" alt=""><figcaption><p>Static</p></figcaption></figure>

<figure><img src="/files/6oy9wArYfz4fhOGJHpZc" alt=""><figcaption><p>Token</p></figcaption></figure>

<figure><img src="/files/DJrwdd4yJuDFBI4JwKGW" alt=""><figcaption><p>Variable</p></figcaption></figure>

{% hint style="info" %}
Please note that when adding the Field Name to the checkbox element, you don't need to include the {{}} format. Example - `my_variable` NOT `{{my_variable}}`
{% endhint %}

### Button

<div align="left"><figure><img src="/files/lB4kURvaRhztt9ZhhCku" alt="" width="161"><figcaption></figcaption></figure></div>

{% embed url="<https://youtu.be/cwhE4IQd2_U?si=xUX8_SZzMjseu0w>\_" %}

The button element allows you to add and dynamically control a button to be clicked in your PDF and send the user to any URL. This can be a static or dynamic element.

You may set the button label, position, size, and color as you wish in the properties.

To set your button dynamically, you can set a field and a value, like so

<figure><img src="/files/JlJccI52Ew2UZQl1nsH0" alt=""><figcaption><p>Static</p></figcaption></figure>

{% hint style="info" %}
The URL you add for the button, either static or from a variable, must start with **https\://** for example <https://documint.me>
{% endhint %}

<figure><img src="/files/mRtiBQSHBJdnwlN5Zrct" alt=""><figcaption><p>Token</p></figcaption></figure>

<figure><img src="/files/Pe9j8MvZzVOs0FkHU27U" alt=""><figcaption><p>Variable</p></figcaption></figure>

{% hint style="info" %}
Please note that when adding variables to the button element, you don't need to include the {{}} format. Example - my\_variable NOT {{my\_variable}}
{% endhint %}

### QR code

<div align="left"><figure><img src="/files/wDJuzfPK1PnF3cfQR6SH" alt="" width="161"><figcaption></figcaption></figure></div>

{% embed url="<https://www.youtube.com/watch?index=12&list=PLYXyDMkKKoW1F5-4pUgq9GDwECBqMTzdw&v=YJEonrr_Qls>" %}

The QR code element allows you to add and dynamically control a QR code in your PDF, which a mobile device can then scan. This can be a static or dynamic element.

You can add text or URLs as the output when scanned.

You may set the QR position, size, foreground, and background color as you wish in the properties.

To set your QR dynamically, you can set a variable and a value, like so

<figure><img src="/files/ZHFMHTsnsodxBIIapyas" alt=""><figcaption><p>Static</p></figcaption></figure>

<figure><img src="/files/wBkUcZHbrdL509fFdBk7" alt=""><figcaption><p>Token</p></figcaption></figure>

<figure><img src="/files/G25oeUMhM8B60Jm5kKon" alt=""><figcaption><p>Variable</p></figcaption></figure>

{% hint style="info" %}
Please note that when adding variables to the QR element you don't need to include the {{}} format. Example - my\_variable NOT {{my\_variable}}
{% endhint %}

**Example Value:** This value will be used in the designer value for variable QRCodes. It will only ever be shown in the template designer when editing your template and will not affect your documents.

### Barcode

<div align="left"><figure><img src="/files/QSfVz7NTP6wFB08RcF8p" alt="" width="161"><figcaption></figcaption></figure></div>

{% embed url="<https://youtu.be/b5qO4y5xTqY?si=l9eKh5Jf9aUGWRzI>" %}

The barcode element allows you to add and dynamically control a barcode in your PDF, which a mobile device can then scan. This can be a static or dynamic element.

You may set the barcode position, size, and color as you wish in the properties.

There are several different barcode types available to suit your needs.

<div align="center"><figure><img src="/files/7ZK3fhL9q2318LN50K7B" alt="" width="329"><figcaption></figcaption></figure></div>

To set your barcode dynamically, you can set a variable and a value, like so

<figure><img src="/files/vrIQLXWKOh2xxgysTASu" alt=""><figcaption><p>Token</p></figcaption></figure>

<figure><img src="/files/AzCER61qH7894Zmc5mGw" alt=""><figcaption><p>Variable</p></figcaption></figure>

{% hint style="info" %}
Please note that when adding variables to the barcode element, you don't need to include the {{}} format. Example - my\_variable NOT {{my\_variable}}
{% endhint %}

### Properties

Once you have placed your element, you control the properties of the element to adjust things like size, spacing, font, color, etc.

<div align="center"><figure><img src="/files/cKnVRTsJMULvmRMs32VD" alt=""><figcaption></figcaption></figure></div>


# Display Rule

{% embed url="<https://www.youtube.com/watch?v=dpg-covPXMY>" %}

### Introduction to the Visual Condition Builder

The new Conditions Editor transforms how you create dynamic, data-driven templates by making conditional logic accessible to everyone—no coding required. With our visual interface, you can easily control when elements appear in your document based on your data.

<figure><img src="/files/WgqU55fsLPSvAelCGMs1" alt=""><figcaption></figcaption></figure>

### Accessing the Condition Editor

To add conditional logic to any element in your template:

1. Select the element you want to make conditional (text, image, section, table row, etc.)
2. Look for the "Edit Logic" button in the Properties panel on the right side
3. Click "Edit Logic" to open the Logic Editor modal

<figure><img src="/files/CuBlz9vbTvqrh35D9wks" alt=""><figcaption></figcaption></figure>

### Understanding the Logic Editor

When the Logic Editor opens, you'll see an intuitive interface for building conditions:

1. **Condition Builder**: The main area where you'll create your logic
2. **Field Selector**: Choose fields from your data source to use in conditions
3. **Operator Controls**: Tools to add AND/OR operators and group conditions

<figure><img src="/files/BT9StF4FR96VFTqxrSjC" alt=""><figcaption></figcaption></figure>

When you close the logic editor you will see how your condition looks in plain language in the properties panel

<figure><img src="/files/PTVPs8emWhuczTHGx7Br" alt=""><figcaption></figcaption></figure>

Elements with conditions are highlighted with an orange border to make them easier to identify within the canvas. Cloning an element will also copy its associated conditions, ensuring the logic is preserved in the duplicate

<figure><img src="/files/9OPzcdmSjBSBZn5SS2gD" alt=""><figcaption></figcaption></figure>

You can preview and test your conditions with dummy data in the "Preview" tab

### Building Your First Condition

Creating a basic condition is simple:

1. In the Logic Editor, click "Add rule"
2. From the field dropdown, select the field you want to evaluate
3. Choose a comparison operator (equals, not equals, greater than, etc.)
4. Enter or select the value to compare against
5. Click "Save" to save your condition

Example: "Show this element if Invoice Status equals 'Paid'"

<figure><img src="/files/HTkf7InJzQ74FsqrOmxJ" alt=""><figcaption></figcaption></figure>

### Creating Complex Conditions

For more sophisticated logic, you can combine multiple conditions:

#### Adding Multiple Rules

1. Click "Add rule" to add another condition
2. By default, all conditions are joined with AND (all must be true)
3. You can click the AND/OR selector to change how conditions are combined

#### Using AND/OR Logic

* **AND**: All conditions must be true (restrictive)
* **OR**: Any condition can be true (permissive)

Example: "Show this element if (Total Amount is greater than $1000) AND (Customer Type equals 'Premium')"

<figure><img src="/files/WzXE1aaSvqcp68vPUJJ2" alt=""><figcaption></figcaption></figure>

### **Removing** Conditions

Once you've added conditions to elements in your template you can clear conditions by opening the Logic Editor and clicking the delete icon on a condition

<figure><img src="/files/YzEVOXSHOx9GEefmz9an" alt=""><figcaption></figcaption></figure>

### Using Custom Conditions

You can use Custom Conditions to define dynamic logic for conditional rendering in your templates using {{#if}} block.

#### Basic usage

If you want to show content only when a document has an author, you’d write:

```
author
```

This is used in your template like so:

```handlebars
{{#if (author)}}
  Written by {{author.name}}
{{/if}}
```

<figure><img src="/files/frDZZ51cNnjC1uYXgVD6" alt=""><figcaption></figcaption></figure>

### Previewing Conditional Elements

To see how conditional elements behave:

1. Switch to Preview mode
2. Your template will display with conditional elements shown or hidden based on your preview data
3. Try different preview data sets to test various scenarios
4. Adjust your condition as needed based on the test results

#### Examples of Practical Conditional Logic

Invoice Template:

* Show "OVERDUE" watermark if payment date is past due
* Display different payment instructions based on payment method
* Include or exclude shipping details based on order type
* Show discount line only if a discount was applied

Contract Template:

* Include specific clauses based on service type
* Show different terms depending on client category
* Display signature blocks based on agreement type
* Include additional forms only when required

<figure><img src="/files/2le2VvWo54LGYvKD7gpc" alt=""><figcaption></figcaption></figure>

### Tips for Effective Conditional Logic

* **Start simple**: Begin with basic conditions before creating complex logic
* **Test thoroughly**: Verify your conditions with different data scenarios
* **Use meaningful groups**: Organize related conditions into logical groups
* **Consider edge cases**: Account for empty values or unexpected data
* **Avoid overlapping conditions**: Ensure conditions don't conflict with each other

In the next section, we'll explore how to work with lists and collections, allowing you to create dynamic, repeating content in your templates.

### Comparison Operators

Depending on the field type, different comparison operators are available:

#### For Text Fields

* Equals
* Does not equal
* Contains
* Does not contain
* Starts with
* Ends with
* Is empty
* Is not empty

<figure><img src="/files/CLht4jFzg8qDW3iS32Nm" alt="" width="563"><figcaption></figcaption></figure>

#### For Number Fields

* Equals
* Does not equal
* Greater than
* Less than
* Greater than or equal to
* Less than or equal to
* Is empty
* Is not empty

<figure><img src="/files/LqEGjrjiI8gOokWBNjcD" alt="" width="563"><figcaption></figcaption></figure>

#### For Date Fields

* Equals
* Does not equal
* Is empty
* Is not empty

<figure><img src="/files/fK8NXjw9AepvmhuivSKM" alt="" width="563"><figcaption></figcaption></figure>

#### For Boolean Fields

* Is equal to

<div><figure><img src="/files/qZaKYm1RXtYsoilUGfXb" alt=""><figcaption></figcaption></figure> <figure><img src="/files/sEzucVtdytFJDKuKwHbm" alt=""><figcaption></figcaption></figure></div>

### Creating Complex Conditions

For more sophisticated logic, you can combine multiple conditions:

#### Adding Multiple Rules

1. Click "Add rule" to add another condition
2. By default, all conditions are joined with AND (all must be true)
3. You can click the AND/OR selector to change how conditions are combined

#### Using AND/OR Logic

* **AND**: All conditions must be true (restrictive)
* **OR**: Any condition can be true (permissive)

Example: "Show this element if (Total Amount is greater than $1000) AND (Customer Type equals 'Premium')"

<figure><img src="/files/nuWlDr6cPg1CniWGwg3A" alt=""><figcaption></figcaption></figure>

### Working with Different Data Types

#### Text Conditions

When working with text fields, you can:

* Compare against exact values
* Check if text contains specific phrases
* Verify if a field starts or ends with certain text
* Test if a field has any value or is empty

<figure><img src="/files/mfkOeu4X6ZaTtqBTVAeY" alt="" width="563"><figcaption></figcaption></figure>

#### Number Conditions

For numerical fields, you can create conditions based on:

* Exact matches
* Value comparisons (greater/less than)
* Ranges (by combining multiple conditions)
* Mathematical relationships between fields

<figure><img src="/files/XPHdp13pq9B82ZXAzNpm" alt="" width="563"><figcaption></figcaption></figure>

#### Date Conditions

Date fields allow for conditions like:

* Specific date matches
* Date ranges
* Relative dates ("is within last 30 days")

<figure><img src="/files/UWkKZ5lECx4TsTSGoBqk" alt="" width="563"><figcaption></figcaption></figure>

#### Boolean Conditions

For true/false fields:

* Check if value is true or false
* Combine with other conditions for more complex logic

<figure><img src="/files/0wFvirENrz27TXYi3pwS" alt="" width="563"><figcaption></figcaption></figure>

### Applying Conditions to Different Elements

Conditions can be applied to various elements in your template:

* **Text blocks**: Show/hide paragraphs or sentences
* **Tables or rows**: Display tables or specific rows conditionally
* **Images**: Include images only when relevant
* **Formatting**: Apply different styles based on conditions

<figure><img src="/files/xVVTIVm7wCYlqqesZMft" alt=""><figcaption></figcaption></figure>

### Managing Conditions

Once you've added conditions to elements in your template:

* **Condition Indicators**: Elements with conditions will display a special indicator
* **Editing**: Select the element and click "Edit Logic" to modify the condition
* **Removing**: Clear conditions by opening the Logic Editor and clicking "Remove"
* **Copying**: You can copy elements with their conditions to reuse them

### Previewing Conditional Elements

To see how conditional elements behave:

1. Switch to Preview mode
2. Your template will display with conditional elements shown or hidden based on your preview data
3. Try different preview data sets to test various scenarios

<figure><img src="/files/E6kDanlJ01oaVIqjyIDH" alt=""><figcaption></figcaption></figure>

### Tips for Effective Conditional Logic

* **Start simple**: Begin with basic conditions before creating complex logic
* **Test thoroughly**: Verify your conditions with different data scenarios
* **Use meaningful groups**: Organize related conditions into logical groups
* **Consider edge cases**: Account for empty values or unexpected data
* **Document complex logic**: Add notes to your template about conditional behavior
* **Avoid overlapping conditions**: Ensure conditions don't conflict with each other

### Examples of Practical Conditional Logic

#### Invoice Template

* Show "OVERDUE" watermark if payment date is past due
* Display different payment instructions based on payment method
* Include or exclude shipping details based on order type
* Show discount line only if a discount was applied

#### Contract Template

* Include specific clauses based on service type
* Show different terms depending on client category
* Display signature blocks based on agreement type
* Include additional forms only when required

In the next section, we'll explore how to work with lists and collections, allowing you to create dynamic, repeating content in your templates.


# Repeat/Loop

### Introduction to Repeating Sections & Lists

Use the Repeat/Loop tab to dynamically render elements for each item in a list (like line\_items). This is especially useful for things like tables, invoice line items, and grouped data.

{% embed url="<https://youtu.be/-sibv-We0bk?si=J1PokATWv26fLOi->" %}

<figure><img src="/files/bxu3gCitHK4XQDl5GLe0" alt=""><figcaption></figcaption></figure>

### Basics

Rows, Columns, and other elements can be repeated for each item in a list of data.

For example, if you are creating an invoice and you want to display all of the products for the order, you can use a repeating row to display each item.

Row elements repeat vertically, and Column elements repeat horizontally.

<img src="/files/0x2AAKzWuUcOqriV6WFz" alt="" width="563">

### Accessing the List Operations

To add a loop to any element in your template:

1. Select the element you want to make repeating (text, image, section, table row, etc.)
2. Look for the "Edit Logic" button in the Properties panel on the right side
3. Click "Edit Logic" to open the Logic Editor modal

<figure><img src="/files/vl3MLdLaUCEyLKLamwPK" alt=""><figcaption></figcaption></figure>

### Creating Repeating Elements

* List Field: Select the array field (e.g. line\_items, tasks, entries) that should drive the repeat.
* The selected element on the canvas will repeat once for each item in that list.
* Each repetition has access to individual item data (e.g. name, price inside a repeated line\_items block).

<figure><img src="/files/gmBgHMNgS5LzHipe0fra" alt=""><figcaption></figcaption></figure>

### Sorting Options

* Click + Add field under “Sort by fields” to specify how items are ordered.
* Sorts can be ascending or descending.

<figure><img src="/files/Dh3igJjVVHTg2AauuURc" alt=""><figcaption></figcaption></figure>

{% embed url="<https://youtu.be/hPpLU4MZqUs?si=aU-bW_Ri2wZaQwRq>" %}

### Filtering List Items

Use the Filter List section to show only matching items. This functions in a similar manner to the [Conditions Editor](/templates/document-structure-and-layout/page-elements/display-rule) but is scoped to the field you're repeating (e.g., line\_items).

{% embed url="<https://youtu.be/MS44AocILak?si=6s8ZF-jvI5nKfHZJ>" %}

<figure><img src="/files/ojFZXd8jBep1LGTSuPQK" alt=""><figcaption></figcaption></figure>

### Nested Lists

You can nest repeaters inside each other:

* Example: orders → line\_items
* Use separate repeat logic in each inner element tied to its own list field.
* Data context will be handled automatically.

{% embed url="<https://youtu.be/3xEBDLYBzoo?si=iIjSGzLj08G28onP>" %}

### Autogenerated Fields vs Manual Fields

Manual inputs are mainly useful when you're using virtual fields or computed values, an example is when computing a group:

```handlebars
{{$var "events" ($group Events "type")}}
```

Here, events is a manually defined variable resulting from a grouped transformation. You’d use manual input to refer to this variable in later logic, since it’s not part of the original schema.

In the next section, we’ll explore how to use the Template Preview to test and refine your logic in real time. This lets you see exactly how your filters, conditions, and repeating elements behave with sample data—making it easier to catch issues and fine-tune your templates before publishing.


# Deprecated Elements

For reference, these are the previous layout elements that have now been deprecated. They will still function and be editable, but you might wish to convert them to the new types for additional functionality.

**Section (Legacy)**

Sections are top-level layout elements used for grouping elements together. This means that they are the only type of element that can be placed in the Body of the template. All other elements must be placed within a section.

<div align="left"><figure><img src="/files/-Ma5UiPkZxPmSe3KAz7O" alt=""><figcaption></figcaption></figure></div>

<figure><img src="/files/osUyLkLO7SvyHfvhtArG" alt=""><figcaption></figcaption></figure>

**Column (Legacy)**

Columns are used for grouping content vertically.

<div align="left"><figure><img src="/files/ZfGGo9JPuwblZ1mlYh7r" alt=""><figcaption></figcaption></figure></div>

<figure><img src="/files/-Ma6dq5PMe4784uGm_Vt" alt=""><figcaption></figcaption></figure>

**Row (Legacy)**&#x20;

Rows are used to group Column elements together.

{% hint style="info" %}
Rows can only be dropped into Column elements.
{% endhint %}

<div align="left"><figure><img src="/files/LI1KPeaSy27BUo7v2bgV" alt=""><figcaption></figcaption></figure></div>

<figure><img src="/files/-Ma6fTaIf3roo3zWcYnF" alt=""><figcaption></figcaption></figure>


# Working with Dynamic Data


# Connections

One of the most significant changes we have made in the current template designer is the introduction of data source connections. Connections simplify the process of creating templates by automatically importing the structure of your data directly into the template builder, so you can just drag and drop your imported tokens.

You will still create your documents via the original integrations methods, but the connection will be responsible for getting your data source fields, so you will no longer have to switch between your data source and Documint template builder to copy and paste your fields.

> **MOTIVATION**:\
> Connections make building your Documint template a lot easier by importing your data source's structure into the template builder and avoiding the tedious process of manually adding your fields into the template.

The new connection feature also lets you preview live record data from your data source in the template preview. No need to go to Airtable (or any other connected data source) and create a test document to see how your template looks!

### How It Works

Connections retrieve the structure of your data directly from your data source. This avoids the tedious process of manually copying your data source fields and pasting them into your Documint template.&#x20;

Once you configure the connection, your connected data source structure will be imported into the tokens panel in the template builder. Now you will just be able to drag and drop your tokens into the template.&#x20;

<div><figure><img src="/files/P42208Fck6F4LHNgO2Wz" alt="" width="375"><figcaption></figcaption></figure> <figure><img src="/files/CN7yxA4u4E5sv3SxuvS3" alt="" width="375"><figcaption><p>The Airtable connection configuration</p></figcaption></figure></div>

And if you make any changes to your data source (for example, you add a field to your Airtable table), you can easily sync your connection again, and those changes will be instantly reflected in the tokens panel.

<figure><img src="/files/O9SDMU5QfgCn0Ajel7OD" alt=""><figcaption></figcaption></figure>

### The Custom Connection

The connection is still a new feature, and currently, we only have the Airtable connection.&#x20;

No worries, though! If you are connecting directly to the Documint API, or your data source does not have a connection yet (as is the case with all integrations except Airtable for now), you can still use the custom connection to build out the structure of your data (schema).&#x20;

<figure><img src="/files/KgCDZvjqmSxVZQ0ctPFX" alt="" width="367"><figcaption></figcaption></figure>

The custom connection allows you to define the structure of your data via the [Fields Editor](/templates/working-with-dynamic-data/fields-editor). Once you save your fields, you will see them appear in the drag-and-drop tokens panel.&#x20;

<figure><img src="/files/Iu6w8NnI2ie4VRsWL8WQ" alt=""><figcaption><p>The field editor</p></figcaption></figure>

<figure><img src="/files/MC1ukZa9MfZa1VJdYPH5" alt="" width="563"><figcaption><p>Your fields are reflected in the drag-and-drop token panel.</p></figcaption></figure>

#### Selecting  your connection

We start the process by selecting a data source connection option. This will display a pop-up that will show a configuration menu for setting up the connection. Currently, you would either select the custom or Airtable connection option.

<figure><img src="/files/zfaZ9nmdgFUZGjvBj1Cg" alt="" width="563"><figcaption></figcaption></figure>

#### Configuring your connection

The configuration process differs by connection.

&#x20;In the case of the Airtable connection (currently the only connection option that connects directly to your data source), you configure it by:

1. Selecting your Airtable integration. These are your provided Airtable personal access tokens (PATs). If you have not set one yet, you will be prompted to provide one.
2. Selecting the base and table you want to use.
3. Selecting the fields and associated tables you want to use.

For detailed instructions on using the connection to Airtable, see [Airtable Connection](/templates/working-with-dynamic-data/connections/airtable-connection).

<figure><img src="/files/qS1Z6fOctpjqGnIOJXdk" alt="" width="375"><figcaption><p>The Airtable connection configuration menu.</p></figcaption></figure>

<figure><img src="/files/JqhAfrn48JmAuZQtmrwn" alt="" width="375"><figcaption><p>Select the fields you want to use.</p></figcaption></figure>

Once you save the connection, your tokens will appear in the drag-and-drop tokens panel.

<figure><img src="/files/nFfqlP3610Ao9I4rR1up" alt="" width="563"><figcaption></figcaption></figure>

#### Disconnecting/Reconnecting your data source

If you have a connection that directly connects to your data source (such as the Airtable connection), you can disconnect it. Once disconnected, your current schema will remain, but you will now be able to edit it in the field editor.

<figure><img src="/files/ACzLJ0mR6kwS0OrT0W4w" alt="" width="367"><figcaption></figcaption></figure>

Reconnecting your data source is just as simple. Just hit the reconnect button!&#x20;

<figure><img src="/files/MxFH6ve0aOzMRb8XuwyP" alt="" width="367"><figcaption></figcaption></figure>

{% hint style="info" %}
Keep in mind: any changes you made while disconnected will be overridden when you reconnect.
{% endhint %}

#### Deleting your data source

If, for one reason or another, you would like to switch connections, just click on the dropdown menu in the connection card and click reset. This will clear the present connection and display all the connection options again.

<figure><img src="/files/6blyTe6HRhkpnqf1t1UM" alt="" width="367"><figcaption><p>Click <code>Configure</code></p></figcaption></figure>

<figure><img src="/files/3nMK6TFHGhsv3GdZoG8X" alt="" width="563"><figcaption><p>Click <code>Reset Schema</code></p></figcaption></figure>

### Where are we heading?

Connections are meant to make the template creation process a lot simpler, so we will be looking to make connections for all integrations where possible.

We will be adding a HubSpot connection next. The HubSpot connection would allow users greater control over the object types and associations they want to use.


# Airtable Connection

### Introduction to Airtable Integration

One of the most powerful features of the new Template Designer is the ability to connect directly to your Airtable bases. This integration automatically imports your field structure and allows you to preview your templates with live data from your Airtable tables.

<figure><img src="/files/rHQMEcbePmV05JkW3lIL" alt=""><figcaption><p>The Airtable connection imports your Airtable field structure directly into the Documint template builder!</p></figcaption></figure>

### Setting Up the Airtable Connection

{% embed url="<https://youtu.be/eZutlqR9Dfo>" %}

#### Connecting to Airtable

1. In the Data Panel, click the "Airtable" button.<br>

<figure><img src="/files/1wxSh5ZtzxWiWMEXOz0U" alt="" width="367"><figcaption></figcaption></figure>

2. The Integration Setup pop-up will open.

<figure><img src="/files/CN7yxA4u4E5sv3SxuvS3" alt="" width="563"><figcaption></figcaption></figure>

#### Authentication Options

In the Integration Setup modal, you have two options:

1. **Select an existing connection**: If you've previously connected Documint to Airtable, you can choose from your saved connections.<br>

   <div align="center"><figure><img src="/files/P42208Fck6F4LHNgO2Wz" alt="" width="563"><figcaption></figcaption></figure></div>
2. **Create a new connection**: If this is your first time connecting your Airtable account.

   <div align="center"><figure><img src="/files/XbfM1vzvTJ7rN0TykrKT" alt="" width="563"><figcaption></figcaption></figure></div>

### Creating a New Airtable Connection

To create a new connection, you'll need to first [generate an Airtable Personal Access Token](/integrations/airtable/add-your-airtable-personal-access-token).

{% stepper %}
{% step %}

### Click "Sign in with Airtable"

In the Integration Setup Popup, click the "Sign in with Airtable" button.

<div align="center"><figure><img src="/files/XbfM1vzvTJ7rN0TykrKT" alt="" width="375"><figcaption></figcaption></figure></div>

{% endstep %}

{% step %}

### Grant access

By default, the name of the connection will be "airtable\_your\_name\_documint\_me". You can leave it as is or change it to whatever you'd like.&#x20;

Grant access to all resources or to specific bases.

<div align="center"><figure><img src="/files/40qx8Fg4Fs0KyjM1wF0c" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

### All set! :tada:

Now you just need to select the connection and map your fields.
{% endstep %}
{% endstepper %}

Once the connection is established, you'll see the connection appear in the "Connection accounts" field.

<div align="center"><figure><img src="/files/P42208Fck6F4LHNgO2Wz" alt="" width="375"><figcaption></figcaption></figure></div>

### Selecting Your Base and Table

Once connected to Airtable, you'll need to select which data to use:

1. From the dropdown, select the Airtable base you want to use.
2. Then select the specific table within that base.
3. Documint will automatically analyze the table structure.

<div align="center" data-full-width="false"><figure><img src="/files/qS1Z6fOctpjqGnIOJXdk" alt="" width="563"><figcaption></figcaption></figure></div>

### Adding fields

Now you can select the fields you'll use on the template.

<figure><img src="/files/q3SxIMSvmaGBEtA8cpma" alt=""><figcaption></figcaption></figure>

### Configuring Linked Records

Airtable's linked records are powerful, and to access their data, you just need to select the fields from the linked table that you'd like to use

<div align="center"><figure><img src="/files/xoph5fyG353kfqx7o3WM" alt=""><figcaption></figcaption></figure></div>

{% hint style="warning" %}
By default, Airtable only provides the IDs of linked records, not their content. To display content from a linked record, select and drag to the template the field you want the value to be displayed.
{% endhint %}

### Finding a Field to select

### Saving Your Configuration

Once you've selected your base, table, and configured any linked records:

1. Click "Finish setup" to confirm your configuration.
2. Documint will import all fields from your selected table and any expanded linked records.
3. These fields will appear as tokens in your Fields Panel, ready to use in your template.

### Working with Airtable Data

{% embed url="<https://youtu.be/QROhqv0--eo>" %}

#### Using Airtable Fields as Tokens

All fields from your Airtable table are automatically available as tokens:

1. Navigate to the Tokens list in the Fields Panel.
2. Find the field you want to use.
3. Drag and drop it into your template.
4. The token will be inserted and will display data from your Airtable table when the document is generated.

<figure><img src="/files/u86zt9VHCrxn0AYh1RVZ" alt=""><figcaption></figcaption></figure>

#### Previewing with Airtable Data

One of the biggest advantages of connecting to Airtable is the ability to preview your template with real data:

1. Navigate to the Preview tab.
2. Your template will display with actual data from your Airtable table.
3. Use this to verify that your template looks correct with real-world data.

<figure><img src="/files/VwyGrf4meA1pYjG903u0" alt=""><figcaption></figcaption></figure>

### Syncing Changes from Airtable

If you make changes to your Airtable structure, you can easily update your template:

1. If you add fields, change field types, or modify your table structure in Airtable.
2. Return to Documint and click the "Sync" button in the Schema.
3. Documint will update your template's field structure to match the current Airtable configuration.
4. Any new fields will be available as tokens, and removed fields will be flagged if used in the template.

<div align="left"><figure><img src="/files/O9SDMU5QfgCn0Ajel7OD" alt=""><figcaption></figcaption></figure></div>

### Disconnecting from Airtable

You can disconnect your template from Airtable if needed:

1. In the Data Panel, click the "Disconnect" button.
2. Documint will convert your template to use a custom data source.
3. The current field structure will be preserved as a custom schema.
4. You can now modify the field structure manually using the Fields Editor.

<figure><img src="/files/ACzLJ0mR6kwS0OrT0W4w" alt="" width="367"><figcaption></figcaption></figure>

### Reconnecting to Airtable

If you've disconnected a template from Airtable, you can reconnect it later:

<figure><img src="/files/MxFH6ve0aOzMRb8XuwyP" alt="" width="367"><figcaption></figcaption></figure>

### Benefits of Airtable Integration

Connecting your templates to Airtable offers several advantages:

* **Automatic field structure**: No need to manually define fields.
* **Real data preview**: Test your templates with actual content.
* **Always in sync**: Keep your templates updated with your latest Airtable structure.
* **Linked record support**: Access related data across tables.
* **Seamless workflow**: Move from data management to document generation without manual steps.

### Troubleshooting Airtable Connections

If you encounter issues with your Airtable connection:

* **Connection fails**: Verify your Personal Access Token has the required permissions.
* **Missing tables**: Ensure you've granted access to the specific base you want to use when creating your Airtable connection.
* **Missing fields**: Check that field names in Airtable haven't changed.
* **Linked record issues**: Verify that the linked records still exist and the relationship is configured correctly.
* **Sync errors**: Try disconnecting and reconnecting to refresh the connection.


# HubSpot (Coming Soon)

> We're currently working on adding a connection for HubSpot.&#x20;


# Fields Editor

### Introduction to the Fields Editor

The Fields Editor is where you define the data structure for your document templates. This completely redesigned interface allows you to visually create and organize your data fields without needing to understand JSON schema or other technical formats.

<figure><img src="/files/HIQa7QpCReAEkUTx8ton" alt="" width="563"><figcaption></figcaption></figure>

### Getting Started with the Fields Editor

To get started with the fields editor, select the custom data source option.

<figure><img src="/files/KgCDZvjqmSxVZQ0ctPFX" alt="" width="367"><figcaption></figcaption></figure>

When creating a new template, you have three ways to set up your fields:

1. **Start from scratch**: Manually define each field one by one.
2. **Paste a JSON schema**: Copy and paste an existing JSON schema to quickly set up your field structure.
3. **Upload a JSON schema file**: Import a JSON schema file directly.

<figure><img src="/files/FmgdA40ijQzLFZ9RlN9V" alt="" width="563"><figcaption></figcaption></figure>

### Field Types

The Fields Editor supports seven fundamental field types, covering all common data needs:

#### 1. String

For text data such as names, descriptions, addresses, and other textual information.

#### 2. Number

For any numerical values such as prices, quantities, percentages, and measurements.

#### 3. Boolean

For true/false or yes/no values.

#### 4. Date/Time

For timestamps, due dates, calendar events, and other time-related information.

#### 5. Objects

For structured data containing multiple related properties. For example, a "customer" object might contain name, email, and address properties.

#### 6. Collections

For arrays or lists of objects with the same structure. For example, invoice line items, where each item has properties like description, quantity, and price.

#### 7. Lists

For simple arrays of primitive values (strings, numbers, booleans, or dates). For example, a list of tags, phone numbers, or dates.

<div><figure><img src="/files/NfuXk5PjBjMplkepEliF" alt=""><figcaption></figcaption></figure> <figure><img src="/files/CQSgfkgQhB8dsR5XhUET" alt=""><figcaption></figcaption></figure></div>

### Creating Simple Fields

Adding a simple field (string, number, boolean, or date) is straightforward:

1. Click the "Add Field" button.
2. Enter a name for your field.
3. Select the field type from the dropdown menu.

<figure><img src="/files/RfAP0VFX5QgjQ0nCO07j" alt=""><figcaption></figcaption></figure>

### Creating Complex Fields

#### Objects

To create an object field:

1. Click the "Add Field" button.
2. Enter a name for your object.
3. Select "Object" as the field type.
4. The object will appear in your fields list with an expandable/collapsible interface.
5. Click the "+ Add Object Field" button within the object to add properties.
6. Add as many properties as needed, of any supported type.

<figure><img src="/files/Jf7fSHcLTefZFTVzfLvO" alt="" width="563"><figcaption></figcaption></figure>

#### Collections

Collections are similar to objects but represent arrays of objects:

1. Click the "Add Field" button.
2. Enter a name for your collection.
3. Select "Collection" as the field type.
4. The collection will appear in your fields list with an expandable/collapsible interface.
5. Click the "+ Add Collection Field" button within the collection to add properties that each item will have.
6. Define the structure of each item in the collection.

<figure><img src="/files/itzVmzj2m0YlQEapN1Z9" alt="" width="563"><figcaption></figcaption></figure>

#### Lists

For simple arrays of primitive values:

1. Click the "Add Field" button.
2. Enter a name for your list.
3. Select "List" as the field type.
4. Select the type of items in the list (string, number, boolean, or date).

<figure><img src="/files/hTTUJ538VUNh664thJuK" alt="" width="563"><figcaption></figcaption></figure>

### Importing Field Definitions

For users who already have a data structure defined in JSON Schema:

1. Click the "Import" button.
2. Choose either "Paste JSON Schema" or "Upload JSON Schema File".
3. If pasting, enter your JSON Schema in the text area and click "Import".
4. If uploading, select your file and click "Open".
5. The Fields Editor will parse the schema and create your field structure.

{% hint style="info" %}
**Note**: Currently, advanced features of JSON Schema, such as references (`$ref`), complex validations, and dependencies are not supported. If your schema contains these elements, they will be simplified during import.
{% endhint %}

### Testing Your Field Structure

Before finalizing your template, it's a good idea to test your field structure:

1. Use the "Preview" feature with sample data.
2. Check that complex fields like collections and objects display as expected.
3. Make adjustments as needed.

In the next section, we'll explore how to connect your template directly to Airtable, allowing Documint to automatically import your field structure.


# Field Tokens

{% embed url="<https://youtu.be/FKeFFUV8i50?si=9HI4_YBzb9VRmz9P>" %}

### What are Tokens?

Tokens are visual representations of your data that you can drag and drop directly into your template. They replace the previous [Handlebars](https://handlebarsjs.com/guide/) syntax (e.g., `{{ variable_name }}`) with intuitive, interactive elements that display your data dynamically when the document is generated.

<figure><img src="/files/dfgpLRCWTtwji2fu7Pfi" alt=""><figcaption><p>Old token panel (left) vs new token panel. Notice the text based (handlebars) tokens in the old version vs the new visual tokens.</p></figcaption></figure>

### How Tokens Differ from Handlebars Syntax

Unlike Handlebars syntax which required you to manually type code with specific formatting, tokens provide a visual approach to inserting dynamic content. This offers several advantages:

* **No syntax to remember**: You don't need to recall specific formatting rules or worry about typos.
* **Immediate visual feedback**: See exactly what you're adding and where.
* **Context awareness**: Tokens understand their position in your document structure.
* **Built-in formatting options**: Customize how your data displays without additional code.
* **Error prevention**: Eliminates common syntax errors like mismatched brackets or incorrect variable names.

### Token Types

Documint supports various data types, each with its own specialized token:

* **Text**: For names, descriptions, addresses, and other string data.
* **Number**: For quantities, prices, percentages, and other numerical values.
* **Date**: For timestamps, due dates, and other calendar information.
* **Boolean**: For yes/no, true/false values.
* **Object**: For structured data containing multiple fields.
* **Array**: For lists of items (like invoice line items or attendees).

Each token type has specific formatting options and behaviors tailored to its data type.

<div><figure><img src="/files/NfuXk5PjBjMplkepEliF" alt=""><figcaption><p>The field editor provides some useful data type for your fields.</p></figcaption></figure> <figure><img src="/files/CQSgfkgQhB8dsR5XhUET" alt=""><figcaption></figcaption></figure></div>

### How to Insert Tokens

1. Define your fields in the Fields Editor or connect to your Airtable table.

<figure><img src="/files/l5naDwi9mCwvJY3cnaHY" alt=""><figcaption></figcaption></figure>

2. Open the Tokens panel in the Template Designer.

<figure><img src="/files/zh12Pera1SoGSwBPNsZG" alt=""><figcaption></figcaption></figure>

3. Find the desired token in the list.
4. Drag and drop it into your template at the desired location.

<figure><img src="/files/F6h1AXQPejuGzoB4olPH" alt=""><figcaption></figcaption></figure>

5. Customize any formatting options if needed.

<figure><img src="/files/lA7189ow1QG6lxuCEtJX" alt=""><figcaption></figcaption></figure>

### Smart Context Awareness

One of the most powerful features of tokens is their ability to understand their context within your document structure.

#### Tokens Inside Repeated Sections

When you place a token inside a repeated section (like an invoice line items table), it automatically displays the correct value for each iteration. For example, in an invoice line items table, placing the "amount" token will display the specific amount for each line item.

<figure><img src="/files/kKreo6RCu5wrkV1O0A2w" alt=""><figcaption></figcaption></figure>

#### Tokens Outside Repeated Sections

When you place a token that belongs to an array or list outside of a repeated section, Documint intelligently offers options for how to display that data:

* **First**: Display only the first item's value.
* **Sum**: Calculate and display the total (for number tokens).
* **Average**: Calculate and display the average (for number tokens).
* **Median**: Calculate and display the median value (for number tokens).
* **Specific**: Select a specific item from the array by index.

This allows you to create summaries, totals, and highlights without writing complex formulas.

<figure><img src="/files/xIVRwHyHqS3N1jiLAX7F" alt="" width="375"><figcaption></figcaption></figure>

### Formatting Options

Each token type offers specific formatting options that you can customize after placing the token in your template:

{% content-ref url="/pages/K04bvwtwFgJ9FG1Coguh" %}
[Token Formatting](/templates/working-with-dynamic-data/field-tokens/token-formatting)
{% endcontent-ref %}

### Token Validation

The Template Designer automatically validates your tokens to ensure they'll work correctly by:

* Showing warning indicators for potential issues.
* Displaying error messages for invalid configurations.
* Suggesting fixes for common problems.

This proactive validation helps prevent errors before you generate documents.

### Example of Tokens Used in an Invoice

#### Invoice Example

* Invoice number
* Customer address
* Customer name
* Customer number
* Line items containing description and price, quantity, and amount (formatted as $0,000.00)
* Subtotal (formatted as $0,000.00)
* Sales tax (formatted as $0,000.00)
* Sales total (formatted as $0,000.00)
* Date (formatted as MM/DD/YYYY)

<figure><img src="/files/En7Kjbidw6VdsqIn4mKj" alt=""><figcaption><p>Invoice example using the tokens.</p></figcaption></figure>

### Best Practices for Using Tokens

* **Organize related tokens**: Group similar fields together in your Fields Editor.
* **Order tokens in the order they appear:** Try to place tokens in the order they appear in the template. Prioritize this practice over keeping related tokens together as mentioned above.
* **Use descriptive names**: Choose clear, meaningful names for your fields.
* **Consider token formatting early**: Think about how data should be displayed when designing your template.
* **Test with sample data**: Use the preview feature to ensure tokens display as expected.
* **Use conditional logic**: Combine tokens with conditions for more dynamic templates.

{% hint style="info" %}
Some of the best practices only apply if you are building out the fields yourself; however, if you are importing the field structure from a data source, you won't be able to control how they are ordered.
{% endhint %}


# Token Formatting

Format variables the way you want them to look

## Number

{% content-ref url="/pages/lCL1n06LDY4aDMZZsGjP" %}
[Number](/templates/working-with-dynamic-data/field-tokens/token-formatting/number)
{% endcontent-ref %}

## Date/Time

{% content-ref url="/pages/DzAgxehw4BkB93QMJTg6" %}
[Date & Time](/templates/working-with-dynamic-data/field-tokens/token-formatting/date-and-time)
{% endcontent-ref %}

## Text

{% content-ref url="/pages/85t8xMffgPaUWrbwqH3i" %}
[Text](/templates/working-with-dynamic-data/field-tokens/token-formatting/text)
{% endcontent-ref %}


# Number

## Number Formatting

{% embed url="<https://youtu.be/ttMJIqvLNHs?si=FD4Wq5IkCMBBJ7PW>" %}

* Decimal places and thousands separators.
* Currency and percentage formatting.
* Default value.
* Display rules.

First, click on the token. To format it, you can click on `Edit Token` on the properties tab, click on the cog icon, or even double-click the token.

<figure><img src="/files/1yLWI0vcmKuP2TknBCyx" alt=""><figcaption></figcaption></figure>

This pop-up will show up. There you'll be able to set up the number formatting:

<figure><img src="/files/IHfclp4TMeoQIoLmxQXA" alt="" width="375"><figcaption></figcaption></figure>

### Plain Number

For a standard number, you can keep the `Number Type` set to `Plain`. To change its format, click on the dropdown menu and select your desired format. You can also specify the number of decimal places you want to display.

<div><figure><img src="/files/nXdFTebH5uRIvDnOpFTJ" alt="" width="375"><figcaption></figcaption></figure> <figure><img src="/files/5PSP0jNgMr79HRUYmelE" alt="" width="375"><figcaption></figcaption></figure></div>

### Currency

And to format a currency, select `Currency` under `Number Type`. Then choose the number of decimal places you want to display. You can also select a locale to display the currency and separators according to the desired location.

<div><figure><img src="/files/tpF5BMDS7TOvJOR4JYKn" alt="" width="375"><figcaption></figcaption></figure> <figure><img src="/files/PEEFiohUPJvb9nlOc5ON" alt="" width="375"><figcaption></figcaption></figure></div>

### Percentage

For the percentage, just choose `Percent` as the `Number Type`. Here you can also select the format and the number of decimal places.

<div><figure><img src="/files/Tkt94Na8xcrHyNvqiolJ" alt="" width="375"><figcaption></figcaption></figure> <figure><img src="/files/cmG1Fvw1ayn9Bmq2k1TC" alt="" width="375"><figcaption></figcaption></figure></div>

### **Custom Formatting**

If you need to change the thousands and decimal separators, you can select custom in the dropdown.&#x20;

<div><figure><img src="/files/BtNX0Ejph9xW9lR4xmnQ" alt="" width="375"><figcaption></figcaption></figure> <figure><img src="/files/Woy2yWA2Vx2xdlf5SXyN" alt="" width="375"><figcaption></figcaption></figure></div>


# Date & Time

## Date Formatting

### Date patterns&#x20;

MM/DD/YYYY, DD/MM/YYYY, etc.

<figure><img src="/files/NwWQYPu1Ol78MAxtJB5q" alt="" width="563"><figcaption></figcaption></figure>

### Custom

It's also possible to set up a custom date pattern

<div><figure><img src="/files/0S7iVmcXzefGxuljh2I0" alt=""><figcaption></figcaption></figure> <figure><img src="/files/JXSC4sH64l1a28gl1ZL6" alt=""><figcaption></figcaption></figure></div>

Here is where you can check the formats available: [Date & Time](/templates/working-with-dynamic-data/legacy-formatting/date-and-time#formats)

### Timezone

Feel free to set up the timezone you need

<figure><img src="/files/rPbfNo78jItDd83wMECV" alt="" width="563"><figcaption></figcaption></figure>

### Display rules

You can make the date field display under a condition

<figure><img src="/files/nfIur59e8umOx6RFnqYU" alt="" width="563"><figcaption></figcaption></figure>


# Text

## Text Formatting

* Plain vs markdown formatting.
* Default value.
* Display rules.

<figure><img src="/files/ADDeYb1hdXl9lEO4jM7m" alt="" width="563"><figcaption></figcaption></figure>

### Rich Text

A text field in your base will, by default, be displayed `Plain`. However, if you have a rich text field in your database, you can format its content to appear correctly in the final document.&#x20;

{% embed url="<https://youtu.be/HAGpBwkkuzQ>" %}

Click on one of these options to edit the token or double-click it.

<figure><img src="/files/p6WsEZsakBNNULk2cqfB" alt=""><figcaption></figcaption></figure>

Then select the `Markdown` option in the Text Type.

<figure><img src="/files/O4BSWPaPtiBEVBUXyp4n" alt="" width="375"><figcaption></figcaption></figure>

You also have two options for Markdown wrap

1. Inline: the content will be displayed on the same line where you added the token
2. Break a new line: the content will be displayed after a line break

And voilá

<figure><img src="/files/bpJSe7l2NjcrnyJH96i6" alt=""><figcaption></figcaption></figure>


# Functions & Operators

{% hint style="warning" %}
Most formatting can be done in the settings for the Fields Token. This is mainly used for formatting that is not yet supported in the Fields Token UI.

<p align="center"><img src="/files/Jrqh22ZxebZOsgwbUYYp" alt=""></p>
{% endhint %}

Documint uses an enhanced version of [Handlebars](https://handlebarsjs.com/guide/#what-is-handlebars) as its templating engine. This means all valid Handlebars syntax is valid Documint syntax. Below is a list of custom functions that can be used in your Documint templates.&#x20;

#### Combining Functions

You can combine functions by wrapping the inner function in parenthesis.

```handlebars
//Example
{{$multiply ($add amount_1 amount_2) ($add amount_3 amount_4)}}
```

Here we're using the `$add` function to sum two sets of values then multiplying them together. Functions in parenthesis will be evaluated first and returned to its parent function.&#x20;

## General

### $calc

The $calc function is a powerful expression evaluator that enables complex calculations, string manipulations, array operations, and provides a secure sandbox environment within your templates.

{% content-ref url="/pages/jzOYDrwNo79Vip129bQJ" %}
[$calc](/legacy-documentation/data-and-variables/functions/calc)
{% endcontent-ref %}

## Math

{% content-ref url="/pages/XRj361DhecINJkv0L5np" %}
[$add](/templates/working-with-dynamic-data/functions-and-operators/functions/math/usdadd)
{% endcontent-ref %}

{% content-ref url="/pages/A5ApeBp9tyTlUWGZsrbr" %}
[$subtract](/templates/working-with-dynamic-data/functions-and-operators/functions/math/usdsubtract)
{% endcontent-ref %}

{% content-ref url="/pages/HIeiSb5VYDgIRf3sTzdd" %}
[$multiply](/templates/working-with-dynamic-data/functions-and-operators/functions/math/usdmultiply)
{% endcontent-ref %}

{% content-ref url="/pages/CTluG3WhoE7cWnyRiVo3" %}
[$divide](/templates/working-with-dynamic-data/functions-and-operators/functions/math/usddivide)
{% endcontent-ref %}

{% content-ref url="/pages/s4YsyYod2SUJzXh49hWR" %}
[$sum](/templates/working-with-dynamic-data/functions-and-operators/functions/math/usdsum)
{% endcontent-ref %}

{% content-ref url="/pages/6Qt29phABeLqZjshTHmb" %}
[$min](/templates/working-with-dynamic-data/functions-and-operators/functions/math/usdmin)
{% endcontent-ref %}

{% content-ref url="/pages/o9880uXz2lqwbzbJiNXl" %}
[$max](/templates/working-with-dynamic-data/functions-and-operators/functions/math/usdmax)
{% endcontent-ref %}

{% content-ref url="/pages/h3Ky97yMqx55gWPcLh97" %}
[$mean](/templates/working-with-dynamic-data/functions-and-operators/functions/math/usdmean)
{% endcontent-ref %}

{% content-ref url="/pages/16TCd3a0KIIaWseyiu3C" %}
[$round](/templates/working-with-dynamic-data/functions-and-operators/functions/math/usdround)
{% endcontent-ref %}

{% content-ref url="/pages/N936qw1WlJrTIGurBnde" %}
[$floor](/templates/working-with-dynamic-data/functions-and-operators/functions/math/usdfloor)
{% endcontent-ref %}

{% content-ref url="/pages/uyyLP5RCxejoK4pENuck" %}
[$ceil](/templates/working-with-dynamic-data/functions-and-operators/functions/math/usdceil)
{% endcontent-ref %}

## List/Arrays

{% content-ref url="/pages/7ICHllP0m5hQd6dafNsK" %}
[#each](/templates/working-with-dynamic-data/functions-and-operators/functions/list-arrays/each)
{% endcontent-ref %}

{% content-ref url="/pages/X1NEZumBAbGoEfIvL7po" %}
[$filter](/templates/working-with-dynamic-data/functions-and-operators/functions/list-arrays/usdfilter)
{% endcontent-ref %}

{% content-ref url="/pages/RFo5MKiCqzAN9rK7E81R" %}
[$group](/templates/working-with-dynamic-data/functions-and-operators/functions/list-arrays/usdgroup)
{% endcontent-ref %}

{% content-ref url="/pages/qaUtgp8lZYxKtRBsPP9h" %}
[$join](/templates/working-with-dynamic-data/functions-and-operators/functions/list-arrays/usdjoin)
{% endcontent-ref %}

## Helpers

{% content-ref url="/pages/rtMPOGDDEEsk4wIwH9Mn" %}
[$extname](/templates/working-with-dynamic-data/functions-and-operators/functions/helpers/usdextname)
{% endcontent-ref %}

{% content-ref url="/pages/iiymsusHXc6nwgRkKFad" %}
[$inspect](/templates/working-with-dynamic-data/functions-and-operators/functions/helpers/usdinspect)
{% endcontent-ref %}

## Content

{% content-ref url="/pages/E8dNzDQ79H7lp6J5MNTP" %}
[$link](/templates/working-with-dynamic-data/functions-and-operators/functions/content/usdlink)
{% endcontent-ref %}

{% content-ref url="/pages/a9MAUpJEcJJmRhRVsRD9" %}
[$md](/templates/working-with-dynamic-data/functions-and-operators/functions/content/usdmd)
{% endcontent-ref %}


# Syntax

Documint templates use [HandlebarsJs](https://handlebarsjs.com/) as the templating language. This means that Documint's variables syntax is the same as Handlebars variable syntax.

### Basic Variables

To create a basic variable you'll give the variable a name without spaces or special characters and wrap it in double curly braces like so:

```
{{myFirstVariable}}
```

{% hint style="info" %}
Depending on your integration setup you may not have the option to map variables to your data source and will need to configure your variables to target the data as it comes over.
{% endhint %}

### Objects

Displaying properties from [objects](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/Basics) is pretty straightforward. All you have to do is first specify the name of the property where the object exists in your data then add a `.` and the name of the property on the object. This is called [dot notation](https://handlebarsjs.com/guide/expressions.html#path-expressions) and is what we use to target sub-properties of objects.

```
{{ person.firstName}}
```

{% hint style="info" %}
**\[objectObject] Error**\
\
If your variable points to an object and not its sub-property then you will receive the `[objectObject]` error. To fix this, simply add the property on the object to the path in your variable.\
\
**Example:**\
{{contact}} => \[objectObject]\
{{contact.name}} => Wile E. Coyote
{% endhint %}

### Arrays

There are two ways to work with [array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) (list) data in your template. You can either loop over an array and display all of the contents of the list like so:

```
{{#each items}}
{{this}}
{{/each}}
```

or you can display a single item in a list like so:

```
{{items.[0]}}
```

{% hint style="info" %}
The example above will display only the first item in the list of `items`. Because lists in Documint are zero-based, the first item in a list is at position `0`.
{% endhint %}

### Field Name with Spaces

If you named a field with spaces, you will need to also wrap the field name in square brackets. Like so:

**Field Name** (token): `Customer Name`

**Variable**: `{{[Customer Name]}}`

### Advanced Variables

#### Accessing deeply nested variables

You can access values nested deep within your data by providing the path.

Rules:

* to access a sub-property, use `.` then the name of the property
* to access a specific item in an array, use the position of the item that you would like to access wrapped in `.` like so: `item.0.name`. This example will access the first item in the array since Documint arrays are zero-based.
* If you are accessing a specific value in a primitive array (an array of [numbers](broken://pages/-Mf-KWZIw6EzwOISMYUi#numbers), [text](broken://pages/-Mf-KWZIw6EzwOISMYUi#strings), or [boolean ](broken://pages/-Mf-KWZIw6EzwOISMYUi#booleans)values) then you will need to wrap the position number in square brackets like so: `names.[1]`. This example will display the second value in a list of `names`. An easy way to remember this is if the number is at the end of the path it needs to be wrapped in square brackets.\ <mark style="background-color:green;">Correct:</mark>     <mark style="background-color:green;">`{{names.[0]}}`</mark>\ <mark style="background-color:red;">Incorrect:</mark>   <mark style="background-color:red;">`{{names.0}}`</mark>

#### Acessing parent variables

If you are within the context of a sub-property in your data (ie. within a loop) you can access the parent data by using the `../` syntax in your variable like so:&#x20;

{% tabs %}
{% tab title="Template" %}
{{#each items }}\
{{../customerName}} bought {{qty}}-{{name}}\
{{/each}}
{% endtab %}

{% tab title="Data" %}

```
{
    customerName: "Wile E. Coyote",
    items:[
        { name:"Glue V1", price: 9.00, qty: 1 },
        { name:"Matches", price: 1.50, qty: 3 },
        { name:"Rocket Powered Skates", price: 370.00, qty: 1 },
    ]{{
}
```

{% endtab %}

{% tab title="Result" %}
Wile E. Coyote bought 1-Glue V1\
Wile E. Coyote bought 3-Matches\
Wile E. Coyote bought 1-Rocket Powered Skates
{% endtab %}
{% endtabs %}

In this example, we are trying to access the name of the customer from within a loop. Because we're looping over `items` we are within the context of the current item when we're trying to display the customer's name. Therefore, we use `../customerName` to navigate one level up from the current context where the `customerName` property exists. You can use `../` as many times as you need to navigate up the data tree. (ie. `../../../var_name`)

Obviously, this example is quite contrived but it demonstrates how to navigate up the data tree when the context has changed.

### Path

A *path* is a string used to access a property deep within the data being merged with your template. For accessing nested properties within an object, use a `.` to access nested properties and `[]` to access a specific item in an array.&#x20;

A *path* is a string used to access a property deep within the data being merged with your template. For accessing nested properties within an object, use a `.` to access nested properties and `[]` to access a specific item in an array.&#x20;

```javascript
// Data
{
    "items":[
        { "name":"Item #1", "qty":10, "price": 50 },
        { "name":"Item #2", "qty":6, "price": 100 }
    ],
    "total_amount": 1100,
    "customer":{
        "address":{
            "street":"123 Main St.",
            "city":"New York",
            "state":"New York"
        }
    }
}

//Path Examples
"items[0].price" // 50
"customer.address.street" // "123 Main St."
```

In the first example, we're giving the path to the `price` property of the first item in the `items` array. In the second example, we're giving the path to the more deeply nested customer street address.

![](/files/QKosWVbtCqVyFf3UClUF)


# Functions

{% content-ref url="/pages/OTSqmfVTD7OcLuiQLuNR" %}
[$calc](/templates/working-with-dynamic-data/functions-and-operators/functions/calc)
{% endcontent-ref %}

{% content-ref url="/pages/69owoqepYuCPZYsaodnw" %}
[$var](/templates/working-with-dynamic-data/functions-and-operators/functions/usdvar)
{% endcontent-ref %}

{% content-ref url="/pages/e3WvunEfL1FbsX384ait" %}
[Math](/templates/working-with-dynamic-data/functions-and-operators/functions/math)
{% endcontent-ref %}

{% content-ref url="/pages/GUxnLmoh9njdoKSvWkdF" %}
[List/Arrays](/templates/working-with-dynamic-data/functions-and-operators/functions/list-arrays)
{% endcontent-ref %}

{% content-ref url="/pages/wkAefSb0Iyq7270JXCNT" %}
[Helpers](/templates/working-with-dynamic-data/functions-and-operators/functions/helpers)
{% endcontent-ref %}

{% content-ref url="/pages/HT088meyC7pjzPYbOLEb" %}
[Content](/templates/working-with-dynamic-data/functions-and-operators/functions/content)
{% endcontent-ref %}


# $calc

The $calc function is a powerful expression evaluator that enables complex calculations, string manipulations, array operations, and provides a secure sandbox environment within your templates.

## Basic Usage

```handlebars
{{$calc "5 + 3"}}              {{!-- outputs: 8 --}}
{{$ "5 + 3"}}                  {{!-- shorthand syntax --}}
```

### Output Types

The function can return different types of values:

* Numbers: Mathematical calculations, statistical results
* Strings: Text manipulation results
* Arrays: Collection operations
* Booleans: Conditional evaluations
* Empty String: Returned for null/undefined values or errors

### Variable Interpolation

Use `{variableName}` syntax to reference context variables:

{% tabs %}
{% tab title="Template" %}

```handlebars
{{$calc "{price} * 1.2"}}      {{!-- outputs: 120 --}}
{{$calc "{user.age} + 5"}}     {{!-- outputs: 30 --}}
```

{% endtab %}

{% tab title="Data" %}

```json
{
  "price": 100,
  "user": {
    "age": 25,
    "name": "John"
  }
}
```

{% endtab %}
{% endtabs %}

### Storing Results

You can store calculation results for later use using the `$var` function:

{% tabs %}
{% tab title="Template" %}

```handlebars
{{$var "tax_amount" ($calc "{price} * 0.2")}}
{{!-- Later in the template --}}
Total with tax: {{$calc "{price} + {tax_amount}"}}
```

{% endtab %}

{% tab title="Data" %}

```json
{
  "price": 100,
  "tax_rate": 0.2
}
```

{% endtab %}
{% endtabs %}

### Formatting Options

#### Decimal Places

```
{{$calc "100 / 3" decimals=2}}  {{!-- outputs: 33.33 --}}
```

#### Custom Number Format (using [number formatter](/help-and-resources/how-to-videos/formatting-tokens#format-numbers) patterns)

```handlebars
{{$calc "1234.5" format="0,0.00"}}  {{!-- outputs: 1,234.50 --}}
{{$calc "0.123" format="0.00%"}}    {{!-- outputs: 12.30% --}}
```

#### Error Handling

```
{{$calc "10/0" error="Division Error"}}  {{!-- outputs: "Division Error" --}}
```

## Function Reference

### Mathematical Functions

#### **Basic Arithmetic**

* Addition (+), Subtraction (-), Multiplication (\*), Division (/), Modulo (%)

```handlebars
{{$calc "5 + 3"}}              {{!-- addition: 8 --}}
{{$calc "5 - 3"}}              {{!-- subtraction: 2 --}}
{{$calc "5 * 3"}}              {{!-- multiplication: 15 --}}
{{$calc "15 / 3"}}             {{!-- division: 5 --}}
{{$calc "5 % 2"}}              {{!-- modulo: 1 --}}
```

#### **Advanced Math Functions**

* abs(x): Returns absolute value of x

```handlebars
{{$calc "abs(-5)"}}            {{!-- absolute value: 5 --}}
```

* max(...args): Returns largest value among arguments

```handlebars
{{$calc "max(1, 2, 3)"}}       {{!-- maximum value: 3 --}}
```

* min(...args): Returns smallest value among arguments

```handlebars
{{$calc "min(1, 2, 3)"}}       {{!-- minimum value: 1 --}}
```

* pow(base, exp): Returns base raised to exp power

```handlebars
{{$calc "pow(2, 3)"}}          {{!-- power: 8 --}}
```

* sqrt(x): Returns square root of x

```handlebars
{{$calc "sqrt(16)"}}           {{!-- square root: 4 --}}
```

* round(x): Rounds to nearest integer

```handlebars
{{$calc "round(3.7)"}}         {{!-- round: 4 --}}
```

* ceil(x): Rounds up to nearest integer

```handlebars
{{$calc "ceil(3.2)"}}          {{!-- ceiling: 4 --}}
```

* floor(x): Rounds down to nearest integer

```handlebars
{{$calc "floor(3.8)"}}         {{!-- floor: 3 --}}
```

### String Operations

* lower(str): Converts string to lowercase

```handlebars
{{$calc 'lower("HELLO")'}}     {{!-- lowercase: "hello" --}}
```

* upper(str): Converts string to uppercase

```handlebars
{{$calc 'upper("hello")'}}     {{!-- uppercase: "HELLO" --}}
```

* trim(str): Removes leading/trailing whitespace

```handlebars
{{$calc 'trim(" hello ")'}}    {{!-- trim whitespace: "hello" --}}
```

* concat(...args): Joins all arguments into single string

```handlebars
{{$calc 'concat("a", "b")'}}   {{!-- concatenate: "ab" --}}
```

* slice(str, start, end): Extracts portion of string

```handlebars
{{$calc 'slice("hello", 0, 2)'}} {{!-- slice string: "he" --}}
```

* replace(str, search, replace): Replaces first occurrence of search with replace

```handlebars
{{$calc 'replace("hello", "l", "w")'}} {{!-- replace: "hewlo" --}}
```

### Array Operations

* arr(...args): Creates array from arguments

```handlebars
{{$calc "arr(1, 2, 3)"}}       {{!-- create array: [1, 2, 3] --}}
```

* first(arr): Returns first element

```handlebars
{{$calc "first([1, 2, 3])"}}   {{!-- first element: 1 --}}
```

* last(arr): Returns last element

```handlebars
{{$calc "last([1, 2, 3])"}}    {{!-- last element: 3 --}}
```

* len(arr): Returns array length

```handlebars
{{$calc "len([1, 2, 3])"}}     {{!-- array length: 3 --}}
```

* join(arr, separator, finalSeparator): Joins array elements with optional custom separators

```handlebars
{{$calc 'join(["a","b"], ",")'}} {{!-- join array: "a,b" --}}
```

* split(str, separator): Splits string into array

```handlebars
{{$calc 'split("a,b", ",")'}}  {{!-- split string: ["a", "b"] --}}
```

* sort(arr): Returns sorted array

```handlebars
{{$calc "sort([3, 1, 2])"}}    {{!-- sort array: [1, 2, 3] --}}
```

* reverse(arr): Returns reversed array

```handlebars
{{$calc "reverse([1, 2, 3])"}} {{!-- reverse array: [3, 2, 1] --}}
```

### Statistical Functions

* avg(...nums): Calculates average of numbers

```handlebars
{{$calc "avg(1, 2, 3)"}}       {{!-- average: 2 --}}
```

* med(nums): Calculates median of array

```handlebars
{{$calc "med([1, 3, 2])"}}     {{!-- median: 2 --}}
```

* sum(nums, \[prop]): Sums array elements, optionally extracting property from objects

```handlebars
{{$calc "sum([1, 2, 3])"}}     {{!-- sum: 6 --}}

{{!-- Sum with object arrays --}}
{{$calc 'sum([{val: 1}, {val: 2}], "val")'}}  {{!-- sum of val property: 3 --}}
```

### Type Conversion

* str(val): Converts to string

```handlebars
{{$calc 'str(123)'}}           {{!-- to string: "123" --}}
```

* num(val): Converts to number

```handlebars
{{$calc 'num("123")'}}         {{!-- to number: 123 --}}
```

* bool(val): Converts to boolean

```handlebars
{{$calc 'bool(1)'}}            {{!-- to boolean: true --}}
```

### Complex Examples

#### Data Processing Pipeline

{% code overflow="wrap" %}

```handlebars
{{!-- Store processed data for later use --}}
{{$var "processed_data" ($calc 'join(sort(arr(concat(upper("hello"), ":", str(sum([1,2,3]))),concat(lower("WORLD"), ":", str(avg(2,4,6)))))," | ")')}}

{{!-- Output: "HELLO:6 | world:4" --}}
{{processed_data}}
```

{% endcode %}

#### Complex Conditional Calculation

```handlebars
{{$calc 'if(len({items}) > 0) then concat("Items: ", join(sort(arr(concat(upper(first({items})), "-", str(sum({values}))), concat(lower(last({items})), "-", str(avg({values})))) ), " | ")) else "No items available"   endif'}}
```

### Limitations and Safety Features

* Maximum number size: 1e15
* Maximum array length: 1000

### Best Practices

* Store intermediate calculations using $var for complex operations
* Use appropriate formatting options for consistent output
* Handle potential errors with the error option
* Break complex calculations into smaller parts
* Use meaningful variable names
* Consider performance with large arrays
* Validate user input before processing
* Use comments to document complex expressions


# $var

Creates a custom variable in your template which you can access from other parts of your template

{% hint style="info" %}
**Note:**&#x20;

Variables must be added to templates before (higher up in the template) they are used.&#x20;

Examples

**Good:**\
`{{$var "tax_rate" 0.07}}` //Variable is declared before it is used

`Tax Rate: {{$number tax_rate "0%"}}`

**Bad:**&#x20;

`Tax Rate: {{$number tax_rate "0%"}}`&#x20;

`{{$var "tax_rate" 0.07}}` //Variable is declared after it is used
{% endhint %}

#### Signature

`{{$var name value}}`

#### Arguments

<table><thead><tr><th width="150">Name</th><th width="235.5333333333333">Description</th><th width="150">Type<select multiple><option value="b0403385da1b4af9a8a894cb7cfa1e88" label="String" color="blue"></option><option value="6a3ca9c830be4cd5a2bcf10d17c44f82" label="Number" color="blue"></option><option value="011b91dfe58a400894b04549ec4f9e02" label="Boolean" color="blue"></option><option value="3c1342f6b38a46e39064bd88015df50d" label="Any" color="blue"></option></select></th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>name</td><td>The name of the variable. This will be used to access it later. Must be a valid JavaScript key</td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String</span></td><td>true</td></tr><tr><td>value</td><td>The value of the variable</td><td><span data-option="3c1342f6b38a46e39064bd88015df50d">Any</span></td><td>true</td></tr></tbody></table>

#### Returns

This function does not have a return value.

#### **Example #1 - Basic**

{% tabs %}
{% tab title="Template" %}

```
{{$var "custom_var" "Custom value"}}
...
{{custom_var}} // Used somewhere else in the template after the above declaration
```

{% endtab %}

{% tab title="Result" %}
Custom value
{% endtab %}
{% endtabs %}

#### Example #2 - Advanced

{% tabs %}
{% tab title="Template" %}
Create a custom variable and set the value to the results of the filter function where we filter items that have a quantity of 10 or more.

![](/files/uTco9ajUqGpGZ0vltaIm)

Repeat the section for each item in the custom variable

![](/files/cZFkrr7R50huT4a3IVm9)
{% endtab %}

{% tab title="Data" %}

```
{
  "items":[
    {
      "name": "Item #1",
      "qty": 5
    },
    {
      "name": "Item #2",
      "qty": 10
    },
    {
      "name": "Item #3",
      "qty": 15
    },
    {
      "name": "Item #4",
      "qty": 20
    }
  ]
}
```

{% endtab %}

{% tab title="Result" %}
![](/files/3x5zIQztKIXZmMQr7QYq)
{% endtab %}
{% endtabs %}

{% hint style="info" %}
Variables can only be accessed after the point in the template where they are declared.
{% endhint %}


# Math

{% content-ref url="/pages/A5ApeBp9tyTlUWGZsrbr" %}
[$subtract](/templates/working-with-dynamic-data/functions-and-operators/functions/math/usdsubtract)
{% endcontent-ref %}

{% content-ref url="/pages/HIeiSb5VYDgIRf3sTzdd" %}
[$multiply](/templates/working-with-dynamic-data/functions-and-operators/functions/math/usdmultiply)
{% endcontent-ref %}

{% content-ref url="/pages/CTluG3WhoE7cWnyRiVo3" %}
[$divide](/templates/working-with-dynamic-data/functions-and-operators/functions/math/usddivide)
{% endcontent-ref %}

{% content-ref url="/pages/s4YsyYod2SUJzXh49hWR" %}
[$sum](/templates/working-with-dynamic-data/functions-and-operators/functions/math/usdsum)
{% endcontent-ref %}

{% content-ref url="/pages/6Qt29phABeLqZjshTHmb" %}
[$min](/templates/working-with-dynamic-data/functions-and-operators/functions/math/usdmin)
{% endcontent-ref %}

{% content-ref url="/pages/o9880uXz2lqwbzbJiNXl" %}
[$max](/templates/working-with-dynamic-data/functions-and-operators/functions/math/usdmax)
{% endcontent-ref %}

{% content-ref url="/pages/h3Ky97yMqx55gWPcLh97" %}
[$mean](/templates/working-with-dynamic-data/functions-and-operators/functions/math/usdmean)
{% endcontent-ref %}

{% content-ref url="/pages/16TCd3a0KIIaWseyiu3C" %}
[$round](/templates/working-with-dynamic-data/functions-and-operators/functions/math/usdround)
{% endcontent-ref %}

{% content-ref url="/pages/N936qw1WlJrTIGurBnde" %}
[$floor](/templates/working-with-dynamic-data/functions-and-operators/functions/math/usdfloor)
{% endcontent-ref %}

{% content-ref url="/pages/uyyLP5RCxejoK4pENuck" %}
[$ceil](/templates/working-with-dynamic-data/functions-and-operators/functions/math/usdceil)
{% endcontent-ref %}


# $add

Add two numbers together

#### Signature

`{{$add number1 number2 [format]}}`

#### Arguments

<table><thead><tr><th width="150">Name</th><th width="272.5333333333333">Description</th><th width="150">Type<select multiple><option value="b0403385da1b4af9a8a894cb7cfa1e88" label="String" color="blue"></option><option value="6a3ca9c830be4cd5a2bcf10d17c44f82" label="Number" color="blue"></option><option value="011b91dfe58a400894b04549ec4f9e02" label="Boolean" color="blue"></option><option value="3c1342f6b38a46e39064bd88015df50d" label="Any" color="blue"></option></select></th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>number1</td><td>The first number in an addition.</td><td><span data-option="6a3ca9c830be4cd5a2bcf10d17c44f82">Number</span></td><td>true</td></tr><tr><td>number2</td><td>The second number in an addition.</td><td><span data-option="6a3ca9c830be4cd5a2bcf10d17c44f82">Number</span></td><td>true</td></tr><tr><td>format</td><td><a href="/pages/-M_x4dVDz1v6rNxxMMP9#standard">Format string</a> used to format the result</td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String</span></td><td>false</td></tr></tbody></table>

#### **Returns**

Returns the total.

**Example**

{% tabs %}
{% tab title="Template" %}

```javascript
{{$add subtotal tax}}
```

{% endtab %}

{% tab title="Data" %}

```json
{
    "subtotal":100,
    "tax": 7.50
}
```

{% endtab %}

{% tab title="Result" %}
107.5
{% endtab %}
{% endtabs %}


# $subtract

Subtracts the second number from the first number.

#### Signature <a href="#subtract" id="subtract"></a>

`{{$subtract number1 number2 [format]}}`

#### Arguments

<table><thead><tr><th width="150">Name</th><th width="272.5333333333333">Description</th><th width="150">Type<select multiple><option value="b0403385da1b4af9a8a894cb7cfa1e88" label="String" color="blue"></option><option value="6a3ca9c830be4cd5a2bcf10d17c44f82" label="Number" color="blue"></option><option value="011b91dfe58a400894b04549ec4f9e02" label="Boolean" color="blue"></option><option value="3c1342f6b38a46e39064bd88015df50d" label="Any" color="blue"></option></select></th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>number1</td><td>The first number in a subtraction.</td><td><span data-option="6a3ca9c830be4cd5a2bcf10d17c44f82">Number</span></td><td>true</td></tr><tr><td>number2</td><td>The second number in a subtraction.</td><td><span data-option="6a3ca9c830be4cd5a2bcf10d17c44f82">Number</span></td><td>true</td></tr><tr><td>format</td><td><a href="/pages/-M_x4dVDz1v6rNxxMMP9#standard">Format string</a> used to format the result</td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String</span></td><td>false</td></tr></tbody></table>

#### **Returns**

Returns the total.

**Example**

{% tabs %}
{% tab title="Template" %}

```javascript
{{$subtract subtotal discount}}
```

{% endtab %}

{% tab title="Data" %}

```json
{
    "subtotal":100,
    "discount": 21.5
}
```

{% endtab %}

{% tab title="Result" %}
78.5
{% endtab %}
{% endtabs %}


# $multiply

Multiplies two numbers together

#### Signature

`{{$multiply number1 number2 [format]}}`

#### Arguments

<table><thead><tr><th width="150">Name</th><th width="272.5333333333333">Description</th><th width="150">Type<select multiple><option value="b0403385da1b4af9a8a894cb7cfa1e88" label="String" color="blue"></option><option value="6a3ca9c830be4cd5a2bcf10d17c44f82" label="Number" color="blue"></option><option value="011b91dfe58a400894b04549ec4f9e02" label="Boolean" color="blue"></option><option value="3c1342f6b38a46e39064bd88015df50d" label="Any" color="blue"></option></select></th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>number1</td><td>The first number in a multiplication.</td><td><span data-option="6a3ca9c830be4cd5a2bcf10d17c44f82">Number</span></td><td>true</td></tr><tr><td>number2</td><td>The second number in a multiplication.</td><td><span data-option="6a3ca9c830be4cd5a2bcf10d17c44f82">Number</span></td><td>true</td></tr><tr><td>format</td><td><a href="/pages/-M_x4dVDz1v6rNxxMMP9#standard">Format string</a> used to format the result</td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String</span></td><td>false</td></tr></tbody></table>

#### **Returns**

Returns the product.

**Example**

{% tabs %}
{% tab title="Template" %}

```javascript
{{$multiply subtotal .075}}
```

{% endtab %}

{% tab title="Data" %}

```json
{
    "subtotal": 150
}
```

{% endtab %}

{% tab title="Result" %}
11.25
{% endtab %}
{% endtabs %}


# $divide

Divides the first number by the second number.

#### Signature

`{{$divide dividend divisor [format]}}`

#### Arguments

<table><thead><tr><th width="150">Name</th><th width="272.5333333333333">Description</th><th width="150">Type<select multiple><option value="b0403385da1b4af9a8a894cb7cfa1e88" label="String" color="blue"></option><option value="6a3ca9c830be4cd5a2bcf10d17c44f82" label="Number" color="blue"></option><option value="011b91dfe58a400894b04549ec4f9e02" label="Boolean" color="blue"></option><option value="3c1342f6b38a46e39064bd88015df50d" label="Any" color="blue"></option></select></th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>dividend</td><td>The first number in a division.</td><td><span data-option="6a3ca9c830be4cd5a2bcf10d17c44f82">Number</span></td><td>true</td></tr><tr><td>divisor</td><td>The second number in a division.</td><td><span data-option="6a3ca9c830be4cd5a2bcf10d17c44f82">Number</span></td><td>true</td></tr><tr><td>format</td><td><a href="/pages/-M_x4dVDz1v6rNxxMMP9#standard">Format string</a> used to format the result</td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String</span></td><td>false</td></tr></tbody></table>

#### **Returns**

Returns the total.

**Example**

{% tabs %}
{% tab title="Template" %}

```javascript
{{$divide wins total_games}}
```

{% endtab %}

{% tab title="Data" %}

```json
{
    "wins": 3,
    "total_games": 15
}
```

{% endtab %}

{% tab title="Result" %}
.2
{% endtab %}
{% endtabs %}


# $sum

Computes the sum of the values.

{% hint style="info" %}
This function has multiple signatures
{% endhint %}

{% tabs %}
{% tab title="Signature 1" %}
`{{$sum array [format]}}`

Computes the sum of [numbers](broken://pages/-Mf-KWZIw6EzwOISMYUi#numbers) in an [array](broken://pages/-Mf-KWZIw6EzwOISMYUi#arrays).

#### Arguments&#x20;

<table><thead><tr><th width="150">Name</th><th width="272.5333333333333">Description</th><th width="150">Type<select multiple><option value="b0403385da1b4af9a8a894cb7cfa1e88" label="String" color="blue"></option><option value="6a3ca9c830be4cd5a2bcf10d17c44f82" label="Number" color="blue"></option><option value="011b91dfe58a400894b04549ec4f9e02" label="Boolean" color="blue"></option><option value="3c1342f6b38a46e39064bd88015df50d" label="Any" color="blue"></option><option value="749256e4cf85463181ee3afefe9c10b2" label="Number Array" color="blue"></option></select></th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>array</td><td>List of numbers to sum.</td><td><span data-option="749256e4cf85463181ee3afefe9c10b2">Number Array</span></td><td>true</td></tr><tr><td>format</td><td><a href="/pages/-M_x4dVDz1v6rNxxMMP9#standard">Format string</a> used to format the result</td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String</span></td><td>false</td></tr></tbody></table>

**Example**&#x20;

{% tabs %}
{% tab title="Template" %}

```javascript
{{$sum hours_worked}}
```

{% endtab %}

{% tab title="Data" %}

```json
{
    "hours_worked": [3, 6, 4, 12]
}
```

{% endtab %}

{% tab title="Result" %}
25
{% endtab %}
{% endtabs %}

####

#### **Returns**

Returns the total.
{% endtab %}

{% tab title="Signature 2" %}
`{{$sum number1 number2 [...] [format]}}`

Computes the sum of numbers passed as arguments.&#x20;

#### Arguments&#x20;

<table><thead><tr><th width="150">Name</th><th width="272.5333333333333">Description</th><th width="150">Type<select multiple><option value="b0403385da1b4af9a8a894cb7cfa1e88" label="String" color="blue"></option><option value="6a3ca9c830be4cd5a2bcf10d17c44f82" label="Number" color="blue"></option><option value="011b91dfe58a400894b04549ec4f9e02" label="Boolean" color="blue"></option><option value="3c1342f6b38a46e39064bd88015df50d" label="Any" color="blue"></option><option value="749256e4cf85463181ee3afefe9c10b2" label="Number Array" color="blue"></option></select></th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>number1</td><td>The first number to sum.</td><td><span data-option="6a3ca9c830be4cd5a2bcf10d17c44f82">Number</span></td><td>true</td></tr><tr><td>number2</td><td>The second number to sum.</td><td><span data-option="6a3ca9c830be4cd5a2bcf10d17c44f82">Number</span></td><td>true</td></tr><tr><td>[...]</td><td>The remaining numbers to sum.</td><td><span data-option="6a3ca9c830be4cd5a2bcf10d17c44f82">Number</span></td><td>false</td></tr><tr><td>format</td><td><a href="/pages/-M_x4dVDz1v6rNxxMMP9#standard">Format string</a> used to format the result</td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String</span></td><td>false</td></tr></tbody></table>

**Example**&#x20;

{% tabs %}
{% tab title="Template" %}

```javascript
{{$sum subtotal discount tax}}
```

{% endtab %}

{% tab title="Data" %}

```json
{
    "subtotal": 150,
    "discount": -20,
    "tax": 6.50
}
```

{% endtab %}

{% tab title="Result" %}
136.5
{% endtab %}
{% endtabs %}

####

#### **Returns**

Returns the total.
{% endtab %}

{% tab title="Signature 3" %}
`{{$sum collection path [format]}}`

Computes the sum of [numbers](broken://pages/-Mf-KWZIw6EzwOISMYUi#numbers) within a [collection](broken://pages/-Mf-KWZIw6EzwOISMYUi#collections) (an [array](broken://pages/-Mf-KWZIw6EzwOISMYUi#arrays) of [objects](broken://pages/-Mf-KWZIw6EzwOISMYUi#objects)).

#### Arguments&#x20;

<table><thead><tr><th width="150">Name</th><th width="272.5333333333333">Description</th><th width="150">Type<select multiple><option value="b0403385da1b4af9a8a894cb7cfa1e88" label="String" color="blue"></option><option value="6a3ca9c830be4cd5a2bcf10d17c44f82" label="Number" color="blue"></option><option value="011b91dfe58a400894b04549ec4f9e02" label="Boolean" color="blue"></option><option value="3c1342f6b38a46e39064bd88015df50d" label="Any" color="blue"></option><option value="749256e4cf85463181ee3afefe9c10b2" label="Number Array" color="blue"></option><option value="44aa8fd70a3e417f9d7fd0c5598d7442" label="Collection" color="blue"></option></select></th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>collection</td><td>An array of objects</td><td><span data-option="44aa8fd70a3e417f9d7fd0c5598d7442">Collection</span></td><td>true</td></tr><tr><td>path</td><td>Path to the number property on each object.</td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String</span></td><td>true</td></tr><tr><td>format</td><td><a href="/pages/-M_x4dVDz1v6rNxxMMP9#standard">Format string</a> used to format the result</td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String</span></td><td>false</td></tr></tbody></table>

**Example**&#x20;

{% tabs %}
{% tab title="Template" %}

```javascript
{{$sum items "price"}}
```

{% endtab %}

{% tab title="Data" %}

```json
{
    "items": [
        { "name":"Rocket Skates", "price":160.3 },
        { "name":"Acme Glue", "price":15.6 },
        { "name":"Wing Suit", "price":699.99 },
    ]
}
```

{% endtab %}

{% tab title="Result" %}
875.89
{% endtab %}
{% endtabs %}

####

#### **Returns**

Returns the total.
{% endtab %}
{% endtabs %}


# $min

Computes the minimum number in an array.

#### Signature

`{{$min array [format]}}`

#### Arguments

<table><thead><tr><th width="150">Name</th><th width="272.5333333333333">Description</th><th width="150">Type<select multiple><option value="b0403385da1b4af9a8a894cb7cfa1e88" label="String" color="blue"></option><option value="6a3ca9c830be4cd5a2bcf10d17c44f82" label="Number" color="blue"></option><option value="011b91dfe58a400894b04549ec4f9e02" label="Boolean" color="blue"></option><option value="3c1342f6b38a46e39064bd88015df50d" label="Any" color="blue"></option><option value="f33f9bdfa8874e71ac20e6f971d27573" label="Number Array" color="blue"></option></select></th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>array</td><td>Array of numbers.</td><td><span data-option="f33f9bdfa8874e71ac20e6f971d27573">Number Array</span></td><td>true</td></tr><tr><td>format</td><td><a href="/pages/-M_x4dVDz1v6rNxxMMP9#standard">Format string</a> used to format the result</td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String</span></td><td>false</td></tr></tbody></table>

#### **Returns**

Returns the minimum value.

**Example**

{% tabs %}
{% tab title="Template" %}

```javascript
{{$min scores}}
```

{% endtab %}

{% tab title="Data" %}

```json
{
    "scores": [ 3, 22, 9, 15 ]
}
```

{% endtab %}

{% tab title="Result" %}
3
{% endtab %}
{% endtabs %}


# $max

Computes the maximum number in an array.

#### Signature

`{{$max array [format]}}`

#### Arguments

<table><thead><tr><th width="150">Name</th><th width="272.5333333333333">Description</th><th width="150">Type<select multiple><option value="b0403385da1b4af9a8a894cb7cfa1e88" label="String" color="blue"></option><option value="6a3ca9c830be4cd5a2bcf10d17c44f82" label="Number" color="blue"></option><option value="011b91dfe58a400894b04549ec4f9e02" label="Boolean" color="blue"></option><option value="3c1342f6b38a46e39064bd88015df50d" label="Any" color="blue"></option><option value="f33f9bdfa8874e71ac20e6f971d27573" label="Number Array" color="blue"></option></select></th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>array</td><td>Array of numbers.</td><td><span data-option="f33f9bdfa8874e71ac20e6f971d27573">Number Array</span></td><td>true</td></tr><tr><td>format</td><td><a href="/pages/-M_x4dVDz1v6rNxxMMP9#standard">Format string</a> used to format the result</td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String</span></td><td>false</td></tr></tbody></table>

#### **Returns**

Returns the maiximum value.

**Example**

{% tabs %}
{% tab title="Template" %}

```javascript
{{$max scores}}
```

{% endtab %}

{% tab title="Data" %}

```json
{
    "scores": [ 3, 22, 9, 15 ]
}
```

{% endtab %}

{% tab title="Result" %}
22
{% endtab %}
{% endtabs %}


# $mean

Computes the average of all values in an array.

#### Signature

`{{$mean array [format]}}`

#### Arguments

<table><thead><tr><th width="150">Name</th><th width="272.5333333333333">Description</th><th width="150">Type<select multiple><option value="b0403385da1b4af9a8a894cb7cfa1e88" label="String" color="blue"></option><option value="6a3ca9c830be4cd5a2bcf10d17c44f82" label="Number" color="blue"></option><option value="011b91dfe58a400894b04549ec4f9e02" label="Boolean" color="blue"></option><option value="3c1342f6b38a46e39064bd88015df50d" label="Any" color="blue"></option><option value="f33f9bdfa8874e71ac20e6f971d27573" label="Number Array" color="blue"></option></select></th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>array</td><td>Array of numbers.</td><td><span data-option="f33f9bdfa8874e71ac20e6f971d27573">Number Array</span></td><td>true</td></tr><tr><td>format</td><td><a href="/pages/-M_x4dVDz1v6rNxxMMP9#standard">Format string</a> used to format the result</td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String</span></td><td>false</td></tr></tbody></table>

#### **Returns**

Returns the average value.

**Example**

{% tabs %}
{% tab title="Template" %}

```javascript
{{$mean scores}}
```

{% endtab %}

{% tab title="Data" %}

```json
{
    "scores": [ 3, 22, 9, 15 ]
}
```

{% endtab %}

{% tab title="Result" %}
12.25
{% endtab %}
{% endtabs %}


# $round

Computes number rounded to precision.

#### Signature

`{{$round number [precision=0] [format]}}`

#### Arguments

<table><thead><tr><th width="150">Name</th><th width="272.5333333333333">Description</th><th width="150">Type<select multiple><option value="b0403385da1b4af9a8a894cb7cfa1e88" label="String" color="blue"></option><option value="6a3ca9c830be4cd5a2bcf10d17c44f82" label="Number" color="blue"></option><option value="011b91dfe58a400894b04549ec4f9e02" label="Boolean" color="blue"></option><option value="3c1342f6b38a46e39064bd88015df50d" label="Any" color="blue"></option><option value="f33f9bdfa8874e71ac20e6f971d27573" label="Number Array" color="blue"></option></select></th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>number</td><td>Array of numbers.</td><td><span data-option="6a3ca9c830be4cd5a2bcf10d17c44f82">Number</span></td><td>true</td></tr><tr><td>precision</td><td>Decimal precision to round to. <em>Default=0</em></td><td><span data-option="6a3ca9c830be4cd5a2bcf10d17c44f82">Number</span></td><td>false</td></tr><tr><td>format</td><td><a href="/pages/-M_x4dVDz1v6rNxxMMP9#standard">Format string</a> used to format the result</td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String</span></td><td>false</td></tr></tbody></table>

#### **Returns**

Returns the rounded value.

**Example**

{% tabs %}
{% tab title="Template" %}

```javascript
{{$round avg_age}}
```

{% endtab %}

{% tab title="Data" %}

```json
{
    "avg_age": 39.486
}
```

{% endtab %}

{% tab title="Result" %}
39
{% endtab %}
{% endtabs %}


# $floor

Computes number rounded down to precision.

#### Signature

`{{$floor number [precision=0] [format]}}`

#### Arguments

<table><thead><tr><th width="150">Name</th><th width="272.5333333333333">Description</th><th width="150">Type<select multiple><option value="b0403385da1b4af9a8a894cb7cfa1e88" label="String" color="blue"></option><option value="6a3ca9c830be4cd5a2bcf10d17c44f82" label="Number" color="blue"></option><option value="011b91dfe58a400894b04549ec4f9e02" label="Boolean" color="blue"></option><option value="3c1342f6b38a46e39064bd88015df50d" label="Any" color="blue"></option><option value="f33f9bdfa8874e71ac20e6f971d27573" label="Number Array" color="blue"></option></select></th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>number</td><td>Array of numbers.</td><td><span data-option="6a3ca9c830be4cd5a2bcf10d17c44f82">Number</span></td><td>true</td></tr><tr><td>precision</td><td><p>Decimal precision to round down to. </p><p><em>Default=0</em></p></td><td><span data-option="6a3ca9c830be4cd5a2bcf10d17c44f82">Number</span></td><td>false</td></tr><tr><td>format</td><td><a href="/pages/-M_x4dVDz1v6rNxxMMP9#standard">Format string</a> used to format the result</td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String</span></td><td>false</td></tr></tbody></table>

#### **Returns**

Returns the rounded down value.

**Example**

{% tabs %}
{% tab title="Template" %}

```javascript
{{$floor avg_age}}
```

{% endtab %}

{% tab title="Data" %}

```json
{
    "avg_age": 39.682
}
```

{% endtab %}

{% tab title="Result" %}
39
{% endtab %}
{% endtabs %}


# $ceil

Computes number rounded up to precision.

#### Signature

`{{$ceil number [precision=0] [format]}}`

#### Arguments

<table><thead><tr><th width="150">Name</th><th width="272.5333333333333">Description</th><th width="150">Type<select multiple><option value="b0403385da1b4af9a8a894cb7cfa1e88" label="String" color="blue"></option><option value="6a3ca9c830be4cd5a2bcf10d17c44f82" label="Number" color="blue"></option><option value="011b91dfe58a400894b04549ec4f9e02" label="Boolean" color="blue"></option><option value="3c1342f6b38a46e39064bd88015df50d" label="Any" color="blue"></option><option value="f33f9bdfa8874e71ac20e6f971d27573" label="Number Array" color="blue"></option></select></th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>number</td><td>Array of numbers.</td><td><span data-option="6a3ca9c830be4cd5a2bcf10d17c44f82">Number</span></td><td>true</td></tr><tr><td>precision</td><td><p>Decimal precision to round down to. </p><p><em>Default=0</em></p></td><td><span data-option="6a3ca9c830be4cd5a2bcf10d17c44f82">Number</span></td><td>false</td></tr><tr><td>format</td><td><a href="/pages/-M_x4dVDz1v6rNxxMMP9#standard">Format string</a> used to format the result</td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String</span></td><td>false</td></tr></tbody></table>

#### **Returns**

Returns the rounded-up value.

**Example**

{% tabs %}
{% tab title="Template" %}

```javascript
{{$ceil avg_age}}
```

{% endtab %}

{% tab title="Data" %}

```json
{
    "avg_age": 39.182
}
```

{% endtab %}

{% tab title="Result" %}
40
{% endtab %}
{% endtabs %}


# List/Arrays

{% content-ref url="/pages/7ICHllP0m5hQd6dafNsK" %}
[#each](/templates/working-with-dynamic-data/functions-and-operators/functions/list-arrays/each)
{% endcontent-ref %}

Loops over an array (list) of items.

***

{% content-ref url="/pages/X1NEZumBAbGoEfIvL7po" %}
[$filter](/templates/working-with-dynamic-data/functions-and-operators/functions/list-arrays/usdfilter)
{% endcontent-ref %}

Filters an array/list of items.

***

{% content-ref url="/pages/RFo5MKiCqzAN9rK7E81R" %}
[$group](/templates/working-with-dynamic-data/functions-and-operators/functions/list-arrays/usdgroup)
{% endcontent-ref %}

Group items together and create a loop of those items

***

{% content-ref url="/pages/qaUtgp8lZYxKtRBsPP9h" %}
[$join](/templates/working-with-dynamic-data/functions-and-operators/functions/list-arrays/usdjoin)
{% endcontent-ref %}

Concatenates an array (list) of items into a string.

***


# #each

Loops over an array (list) of items.

This is different than the other functions because it has an opening (`{{#each}}`) and closing (`{{/each}}`) tag and uses an `#` instead of a `$` to prefix the function name. The content within the opening and closing tags is set to the context of the current item in the loop. This means that any variables used within the opening and closing tags are relative to the current item in the loop. If the list of items being looped over is a list of objects, then variable names will represent properties on that object. See example below.

#### Signature

`{{#each array }}{{this}}{{/each}}`

#### Arguments

<table><thead><tr><th width="150">Name</th><th width="272.5333333333333">Description</th><th width="150">Type<select multiple><option value="b0403385da1b4af9a8a894cb7cfa1e88" label="String" color="blue"></option><option value="6a3ca9c830be4cd5a2bcf10d17c44f82" label="Number" color="blue"></option><option value="011b91dfe58a400894b04549ec4f9e02" label="Boolean" color="blue"></option><option value="3c1342f6b38a46e39064bd88015df50d" label="Any" color="blue"></option><option value="cebed7abfeee4c25af96f5c9466ac453" label="String Array" color="blue"></option><option value="8a76c273e1c54778b694497f2a693355" label="Number Array" color="blue"></option><option value="addea9408e6745c9be865b7e946eabca" label="Boolean Array" color="blue"></option><option value="84571f0adb4e4f3daf96174af67f175a" label="Object Array" color="blue"></option><option value="1e4385b940ee4a27a0a2bb649df86e6d" label="Array Array" color="blue"></option></select></th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>array</td><td>List of items to repeat/loop over</td><td><span data-option="cebed7abfeee4c25af96f5c9466ac453">String Array, </span><span data-option="8a76c273e1c54778b694497f2a693355">Number Array, </span><span data-option="addea9408e6745c9be865b7e946eabca">Boolean Array, </span><span data-option="84571f0adb4e4f3daf96174af67f175a">Object Array, </span><span data-option="1e4385b940ee4a27a0a2bb649df86e6d">Array Array</span></td><td>true</td></tr></tbody></table>

#### **Returns**

Content within the opening and closing tags, for each item in the given array/list.

#### **Example - Array of Objects**

In this example we're looping over an array/list of Objects. We can access the properties of the current object in the loop simply by using the name of the property. In the case below, we're displaying the `name` property of each object using the `{{name}}` token. This works because the within the opening and closing tags of the `#each` function, the context is set to the current item in the loop.&#x20;

{% tabs %}
{% tab title="Template" %}

```handlebars
{{#each characters}}{{name}}, {{/each}}
```

{% endtab %}

{% tab title="Data" %}

```json
{
    "characters": [
        { "name": "Wile E. Coyote", "email":"wile.coyote@acme.co" },
        { "name": "Road Runer",     "email":"road.runner@acme.co" }
    ]
}
```

{% endtab %}

{% tab title="Result" %}
Wile E. Coyote, Road Runner&#x20;
{% endtab %}
{% endtabs %}

#### **Example - Array of Strings**

In this example, we're looping over an array/list of Strings. We use the `this` keyword to reference the current item in the loop. `this` always represents the current item in the loop, even when looping over data types other than Strings.

{% tabs %}
{% tab title="Template" %}

```handlebars
{{#each characters}}{{this}}, {{/each}}
```

{% endtab %}

{% tab title="Data" %}

```json
{
    "characters": [ "Wile E. Coyote", "Road Runer" ]
}
```

{% endtab %}

{% tab title="Result" %}
Wile E. Coyote, Road Runner&#x20;
{% endtab %}
{% endtabs %}


# $filter

Filters an array/list of items.

#### Signature

`{{$filter array` [`path`](broken://pages/ABxtwZEqy7Nm8F6f8MWG#path)[`operator`](broken://pages/F81mkpgvzTOk4bSyonvu) `[value]}}`

#### Arguments

<table><thead><tr><th width="150">Name</th><th width="272.5333333333333">Description</th><th width="150">Type<select multiple><option value="b0403385da1b4af9a8a894cb7cfa1e88" label="String" color="blue"></option><option value="6a3ca9c830be4cd5a2bcf10d17c44f82" label="Number" color="blue"></option><option value="011b91dfe58a400894b04549ec4f9e02" label="Boolean" color="blue"></option><option value="3c1342f6b38a46e39064bd88015df50d" label="Any" color="blue"></option><option value="fe749c5299b341f8a6aaa533ce045b4d" label="String Array" color="blue"></option><option value="525618894ebe442ca9721339fc729e56" label="Number Array" color="blue"></option><option value="d5f34c3a9e6d4a0da0490ee7be091a26" label="Object Array" color="blue"></option><option value="72a2ef6ca94a4272bc70b7acaceec18e" label="" color="blue"></option></select></th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>array</td><td>Accepts either an array of data or a relative <a href="/pages/ABxtwZEqy7Nm8F6f8MWG#path">path</a>, as a String, to an array.</td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String, </span><span data-option="fe749c5299b341f8a6aaa533ce045b4d">String Array, </span><span data-option="525618894ebe442ca9721339fc729e56">Number Array, </span><span data-option="d5f34c3a9e6d4a0da0490ee7be091a26">Object Array</span></td><td>true</td></tr><tr><td><a href="/pages/ABxtwZEqy7Nm8F6f8MWG#path">path</a></td><td><p>Path to property if looping over an array/list of Objects. </p><p><strong>Note</strong>: If looping over a list of Strings, Numbers or Booleans then this should be the <a href="/pages/F81mkpgvzTOk4bSyonvu">operator</a>.</p></td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String</span></td><td>true</td></tr><tr><td><a href="/pages/F81mkpgvzTOk4bSyonvu">operator</a></td><td><p>The operator used to evaluate each item in the array/list. </p><p><strong>Note</strong>: If looping over an array/list of Strings, Numbers or Booleans then this should be the value to check against.</p></td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String</span></td><td>true</td></tr><tr><td>value</td><td>The value to compare variable's value to. Required when using an operator that requries two arguments.</td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String, </span><span data-option="6a3ca9c830be4cd5a2bcf10d17c44f82">Number, </span><span data-option="011b91dfe58a400894b04549ec4f9e02">Boolean</span></td><td>false</td></tr></tbody></table>

#### Example - Array of Objects

{% tabs %}
{% tab title="Template" %}

```handlebars
{{$filter products "category" "isIn" "Disguise,Explosive"}}
```

{% endtab %}

{% tab title="Data" %}

```json
{
  "products": [
    { "name":"Batman Costume", "category":"Disguise" }, 
    { "name":"TNT", "category":"Explosive" },
    { "name":"Jet-Propelled Unicycle", "category":"Transportation" }
  ]
}
```

{% endtab %}

{% tab title="Result" %}

```json
[
  { "name":"Batman Costume", "category":"Disguise" }, 
  { "name":"TNT", "category":"Explosive" }
]
```

{% endtab %}
{% endtabs %}

Video walk-through of the filter process

{% embed url="<https://youtu.be/zd0XL-SQFGo>" %}


# $group

Group items together and create a loop of those items

Video walk-through of the group process

{% embed url="<https://youtu.be/P_uoqYdHnwU>" %}


# $join

Concatenates an array (list) of items into a string.

#### Signature

`{{$join array [path] [separator] [final] }}`

#### Arguments

<table><thead><tr><th width="150">Name</th><th width="272.5333333333333">Description</th><th width="150">Type<select multiple><option value="b0403385da1b4af9a8a894cb7cfa1e88" label="String" color="blue"></option><option value="6a3ca9c830be4cd5a2bcf10d17c44f82" label="Number" color="blue"></option><option value="011b91dfe58a400894b04549ec4f9e02" label="Boolean" color="blue"></option><option value="3c1342f6b38a46e39064bd88015df50d" label="Any" color="blue"></option><option value="fe749c5299b341f8a6aaa533ce045b4d" label="String Array" color="blue"></option><option value="525618894ebe442ca9721339fc729e56" label="Number Array" color="blue"></option><option value="d5f34c3a9e6d4a0da0490ee7be091a26" label="Object Array" color="blue"></option><option value="72a2ef6ca94a4272bc70b7acaceec18e" label="" color="blue"></option></select></th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>array</td><td>Accepts either an array of data or a relative <a href="/pages/ABxtwZEqy7Nm8F6f8MWG#path">path</a>, as a String, to an array.</td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String, </span><span data-option="fe749c5299b341f8a6aaa533ce045b4d">String Array, </span><span data-option="525618894ebe442ca9721339fc729e56">Number Array, </span><span data-option="d5f34c3a9e6d4a0da0490ee7be091a26">Object Array</span></td><td>true</td></tr><tr><td>path</td><td><p>If the array is a collection (an array of objects) then use this <a href="/pages/ABxtwZEqy7Nm8F6f8MWG#path">path</a> to specify which property in the object should be concatenated.</p><p><mark style="color:blue;"><strong>Default value</strong></mark>: ", "</p></td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String</span></td><td>false</td></tr><tr><td>separator</td><td>String that separates each item in the array.</td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String</span></td><td>false</td></tr><tr><td>final</td><td>The string that's used to separate the last two items.</td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String</span></td><td>false</td></tr></tbody></table>

#### Example #1 - Array of strings

{% tabs %}
{% tab title="Template" %}

```handlebars
{{$join categories ", " " & "}}
```

{% endtab %}

{% tab title="Data" %}

```json
{
  "categories": ["Disguise", "Explosive", "Transportation"]
}
```

{% endtab %}

{% tab title="Result" %}
Disguise, Maintenance & Transportation
{% endtab %}
{% endtabs %}

#### Example #2- Collection (array of objects)

{% tabs %}
{% tab title="Template" %}

```handlebars
{{$join items "name" ", " " & "}}
```

{% endtab %}

{% tab title="Data" %}

```json
{
  "items": [
    { "name": "Glue V1", "price": 9.99 },
    { "name": "Artificial Rock", "price": 26.99 },
    { "name": "Bat-Man's Outfit", "price": 159.99 }
  ]
}
```

{% endtab %}

{% tab title="Result" %}
Glue V1, Artificial Rock & Bat-Man's Outfit
{% endtab %}
{% endtabs %}

#### Example #3 - Path to array

{% tabs %}
{% tab title="Template" %}

```handlebars
{{$join "company.employees" "name" ", " " & "}}
```

{% endtab %}

{% tab title="Data" %}

```json
{
  "company": {
    "name": "Acme Co.",
    "employees": [
      {
        "name": "Bernadine Burton",
        "role": "Decoy"
      },
      {
        "name": "Good Battle",
        "role": "Field Agent"
      },
      {
        "name": "Dennis Miles",
        "role": "Field Agent"
      }
    ]
  }
}
```

{% endtab %}

{% tab title="Result" %}
Bernadine Burton, Good Battle & Dennis Miles
{% endtab %}
{% endtabs %}


# Helpers

{% content-ref url="/pages/rtMPOGDDEEsk4wIwH9Mn" %}
[$extname](/templates/working-with-dynamic-data/functions-and-operators/functions/helpers/usdextname)
{% endcontent-ref %}

Returns the extension name of a filename.

***

{% content-ref url="/pages/iiymsusHXc6nwgRkKFad" %}
[$inspect](/templates/working-with-dynamic-data/functions-and-operators/functions/helpers/usdinspect)
{% endcontent-ref %}

Displays the raw merge data used to create the document. Useful for debugging your template when merging documents.

***


# $extname

Returns the extension name of a filename.

#### Signature

`{{$extname filename }}`

#### Arguments

<table><thead><tr><th width="150">Name</th><th width="272.5333333333333">Description</th><th width="150">Type<select multiple><option value="b0403385da1b4af9a8a894cb7cfa1e88" label="String" color="blue"></option><option value="6a3ca9c830be4cd5a2bcf10d17c44f82" label="Number" color="blue"></option><option value="011b91dfe58a400894b04549ec4f9e02" label="Boolean" color="blue"></option><option value="3c1342f6b38a46e39064bd88015df50d" label="Any" color="blue"></option><option value="fe749c5299b341f8a6aaa533ce045b4d" label="String Array" color="blue"></option><option value="525618894ebe442ca9721339fc729e56" label="Number Array" color="blue"></option><option value="d5f34c3a9e6d4a0da0490ee7be091a26" label="Object Array" color="blue"></option><option value="72a2ef6ca94a4272bc70b7acaceec18e" label="" color="blue"></option></select></th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>filename</td><td>The name of the file that you're trying to get the extension name of.</td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String</span></td><td>true</td></tr></tbody></table>

#### Example

{% tabs %}
{% tab title="Template" %}

```
{{$extname filename}}
```

{% endtab %}

{% tab title="Data" %}

```json
{
  "filename": "https://acmec.co/assets/image.jpg"
}
```

{% endtab %}

{% tab title="Result" %}
jpg
{% endtab %}
{% endtabs %}


# $inspect

Displays the raw merge data used to create the document. Useful for debugging your template when merging documents.

#### Signature

`{{$inspect [expandDepth=1]}}`

#### Arguments

<table><thead><tr><th width="169">Name</th><th width="272.5333333333333">Description</th><th width="150">Type<select multiple><option value="b0403385da1b4af9a8a894cb7cfa1e88" label="String" color="blue"></option><option value="6a3ca9c830be4cd5a2bcf10d17c44f82" label="Number" color="blue"></option><option value="011b91dfe58a400894b04549ec4f9e02" label="Boolean" color="blue"></option><option value="3c1342f6b38a46e39064bd88015df50d" label="Any" color="blue"></option><option value="fe749c5299b341f8a6aaa533ce045b4d" label="String Array" color="blue"></option><option value="525618894ebe442ca9721339fc729e56" label="Number Array" color="blue"></option><option value="d5f34c3a9e6d4a0da0490ee7be091a26" label="Object Array" color="blue"></option><option value="72a2ef6ca94a4272bc70b7acaceec18e" label="" color="blue"></option></select></th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>expandDepth</td><td>The number of levels deep to expand nested objects and arrays. Unexpaded objects will will display as [object Object] and unexpected arrays will display as [array Object]</td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String, </span><span data-option="6a3ca9c830be4cd5a2bcf10d17c44f82">Number</span></td><td>false</td></tr></tbody></table>

#### Example

{% tabs %}
{% tab title="Template" %}

```handlebars
{{$inspect 2}}
```

{% endtab %}

{% tab title="Data" %}

```json
{
    "name":"Order 2321",
    "account":[
        {
            "name":"Acme Co.",
            "address":{
                "street": "123 Main St.",
                "city": "New York",
                "state": "New York"
            }
        }
    ],
    "items":[
        { "name":"Widget 1", "price":123, "qty": 1, "amount": 123 },
        { "name":"Widget 2", "price":321, "qty": 1, "amount": 321 },
        { "name":"Widget 3", "price": 456, "qty": 1, "amount": 456 },
    ]
}
```

{% endtab %}

{% tab title="Result" %}
![](/files/4VPkk9uwpXRviD8mif8P)
{% endtab %}
{% endtabs %}


# Content

{% content-ref url="/pages/E8dNzDQ79H7lp6J5MNTP" %}
[$link](/templates/working-with-dynamic-data/functions-and-operators/functions/content/usdlink)
{% endcontent-ref %}

Creates a link to a given URL

***

{% content-ref url="/pages/a9MAUpJEcJJmRhRVsRD9" %}
[$md](/templates/working-with-dynamic-data/functions-and-operators/functions/content/usdmd)
{% endcontent-ref %}

Renders markdown content


# $link

Creates a link to a given URL

#### Signature

`{{$link url [text]}}`

#### Arguments

<table><thead><tr><th width="150">Name</th><th width="272.5333333333333">Description</th><th width="150">Type<select multiple><option value="b0403385da1b4af9a8a894cb7cfa1e88" label="String" color="blue"></option><option value="6a3ca9c830be4cd5a2bcf10d17c44f82" label="Number" color="blue"></option><option value="011b91dfe58a400894b04549ec4f9e02" label="Boolean" color="blue"></option><option value="3c1342f6b38a46e39064bd88015df50d" label="Any" color="blue"></option></select></th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>url</td><td>URL value of the link</td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String</span></td><td>true</td></tr><tr><td>text</td><td>Text to display in document. If no value is provided the URL of the link will be displayed</td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String</span></td><td>false</td></tr></tbody></table>

#### **Returns**

Link to the given URL.

**Example**

{% tabs %}
{% tab title="Template" %}

```javascript
{{$link company.website}}
{{$link company.website company.name}}
```

{% endtab %}

{% tab title="Data" %}

```json
{
    "company":{
        "name":"Acme Co.",
        "website":"https://www.acme.co"
    }
}
```

{% endtab %}

{% tab title="Result" %}
<https://www.acme.co>

[Acme Co.](https://www.acme.co)
{% endtab %}
{% endtabs %}


# $md

Renders markdown content

#### Signature

`{{$md content}}`

#### Arguments

<table><thead><tr><th width="150">Name</th><th width="272.5333333333333">Description</th><th width="150">Type<select multiple><option value="b0403385da1b4af9a8a894cb7cfa1e88" label="String" color="blue"></option><option value="6a3ca9c830be4cd5a2bcf10d17c44f82" label="Number" color="blue"></option><option value="011b91dfe58a400894b04549ec4f9e02" label="Boolean" color="blue"></option><option value="3c1342f6b38a46e39064bd88015df50d" label="Any" color="blue"></option></select></th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>content</td><td>Markdown content</td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String</span></td><td>true</td></tr></tbody></table>

#### **Example**

{% tabs %}
{% tab title="Template" %}

```handlebars
{{$md notes}}
```

{% endtab %}

{% tab title="Data" %}

```json
{
    "notes":"Before moving forward you need to complete the following items:\n[ ] Checklist item one\n[x] Checklist item two\n[ ] Checklist item three\n"
}
```

{% endtab %}

{% tab title="Result" %}
![](/files/GtS0jEcVfU3sx98Bpkr7)
{% endtab %}
{% endtabs %}

{% hint style="info" %}
**Troubleshooting**

Spaces at the end of content  wrapped in tags such as \*\* will render the tags as raw text.&#x20;

**Example:**

`"Howdy, **Partner! **"` renders as \*\*Howdy, Partner! \*\*

`"Howdy, **Partner!**" renders as Howdy,`` `**`Partner!`**
{% endhint %}


# Operators

{% content-ref url="/pages/X0QdM1itjsmwVPl7AYTY" %}
[Comparison Operators](/templates/working-with-dynamic-data/functions-and-operators/operators/comparison-operators)
{% endcontent-ref %}

{% content-ref url="/pages/ok1zPvD7jnHMEFF0JLeI" %}
[Identity Operators](/templates/working-with-dynamic-data/functions-and-operators/operators/identity-operators)
{% endcontent-ref %}

{% content-ref url="/pages/EwEXHUmgoPjU7fXJDZQS" %}
[Array Operators](/templates/working-with-dynamic-data/functions-and-operators/operators/array-operators)
{% endcontent-ref %}

{% content-ref url="/pages/PtYAmUKfK1EVeaeQtxFF" %}
[String Operators](/templates/working-with-dynamic-data/functions-and-operators/operators/string-operators)
{% endcontent-ref %}

{% content-ref url="/pages/yqYposBHRbJsLKkyxlC7" %}
[Logical Operators](/templates/working-with-dynamic-data/functions-and-operators/operators/logical-operators)
{% endcontent-ref %}


# Comparison Operators

### eq

`{{$eq value1 value2}}`

Evaluates to `true` if `value1` is **equal to** `value2`.

**Arguments**

<table><thead><tr><th width="150">Name</th><th width="272.5333333333333">Description</th><th width="150">Type<select multiple><option value="b0403385da1b4af9a8a894cb7cfa1e88" label="String" color="blue"></option><option value="6a3ca9c830be4cd5a2bcf10d17c44f82" label="Number" color="blue"></option><option value="011b91dfe58a400894b04549ec4f9e02" label="Boolean" color="blue"></option><option value="3c1342f6b38a46e39064bd88015df50d" label="Any" color="blue"></option></select></th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>value1</td><td>A static value or a variable path</td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String, </span><span data-option="6a3ca9c830be4cd5a2bcf10d17c44f82">Number, </span><span data-option="011b91dfe58a400894b04549ec4f9e02">Boolean</span></td><td>true</td></tr><tr><td>value2</td><td>A static value or a variable path</td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String, </span><span data-option="6a3ca9c830be4cd5a2bcf10d17c44f82">Number, </span><span data-option="011b91dfe58a400894b04549ec4f9e02">Boolean</span></td><td>true</td></tr></tbody></table>

**Returns**

&#x20; *(*[*Boolean*](/legacy-documentation/data-and-variables/data-types#booleans)*)*

**Example**

{% tabs %}
{% tab title="Template" %}
{{#if ($eq category "sports") }}Category is sports{{/if}}
{% endtab %}

{% tab title="Data" %}

```json
{
    "category":"sports"
}
```

{% endtab %}

{% tab title="Result" %}
Category is sports
{% endtab %}
{% endtabs %}

### ne

`{{$ne value1 value2}}`

Evaluates to `true` if `value1` is **not equal to** `value2`.

**Arguments**

<table><thead><tr><th width="150">Name</th><th width="272.5333333333333">Description</th><th width="150">Type<select multiple><option value="b0403385da1b4af9a8a894cb7cfa1e88" label="String" color="blue"></option><option value="6a3ca9c830be4cd5a2bcf10d17c44f82" label="Number" color="blue"></option><option value="011b91dfe58a400894b04549ec4f9e02" label="Boolean" color="blue"></option><option value="3c1342f6b38a46e39064bd88015df50d" label="Any" color="blue"></option></select></th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>value1</td><td>A static value or a variable path</td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String, </span><span data-option="6a3ca9c830be4cd5a2bcf10d17c44f82">Number, </span><span data-option="011b91dfe58a400894b04549ec4f9e02">Boolean</span></td><td>true</td></tr><tr><td>value2</td><td>A static value or a variable path</td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String, </span><span data-option="6a3ca9c830be4cd5a2bcf10d17c44f82">Number, </span><span data-option="011b91dfe58a400894b04549ec4f9e02">Boolean</span></td><td>true</td></tr></tbody></table>

**Returns**

&#x20; *(*[*Boolean*](/legacy-documentation/data-and-variables/data-types#booleans)*)*

**Example**

{% tabs %}
{% tab title="Template" %}
{{#if ($ne category "sports") }}Category is not sports{{/if}}
{% endtab %}

{% tab title="Data" %}

```json
{
    "category":"sports"
}
```

{% endtab %}

{% tab title="Result" %}
This is a sports category
{% endtab %}
{% endtabs %}

### gt

`{{$gt number1 number2}}`

Evaluates to `true` if `number1` is **greater than** the `number2`.

**Arguments**

<table><thead><tr><th width="150">Name</th><th width="272.5333333333333">Description</th><th width="150">Type<select multiple><option value="b0403385da1b4af9a8a894cb7cfa1e88" label="String" color="blue"></option><option value="6a3ca9c830be4cd5a2bcf10d17c44f82" label="Number" color="blue"></option><option value="011b91dfe58a400894b04549ec4f9e02" label="Boolean" color="blue"></option><option value="3c1342f6b38a46e39064bd88015df50d" label="Any" color="blue"></option></select></th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>number1</td><td>A static value or a variable path</td><td><span data-option="6a3ca9c830be4cd5a2bcf10d17c44f82">Number</span></td><td>true</td></tr><tr><td>number2</td><td>A static value or a variable path</td><td><span data-option="6a3ca9c830be4cd5a2bcf10d17c44f82">Number</span></td><td>true</td></tr></tbody></table>

**Returns**

*(*[*Boolean*](/legacy-documentation/data-and-variables/data-types#booleans)*)*

**Example**

{% tabs %}
{% tab title="Template" %}
{{#if ($gt grand\_total 1500) }}Grand total is greater than 1500{{/if}}
{% endtab %}

{% tab title="Data" %}

```json
{
    "grand_total": 1600
}
```

{% endtab %}

{% tab title="Result" %}
Grand total is greater than 1500
{% endtab %}
{% endtabs %}

### lt

`{{$lt number1 number2}}`

Evaluates to `true` if `number1` is **less than** `number2`.

**Arguments**

<table><thead><tr><th width="150">Name</th><th width="272.5333333333333">Description</th><th width="150">Type<select multiple><option value="b0403385da1b4af9a8a894cb7cfa1e88" label="String" color="blue"></option><option value="6a3ca9c830be4cd5a2bcf10d17c44f82" label="Number" color="blue"></option><option value="011b91dfe58a400894b04549ec4f9e02" label="Boolean" color="blue"></option><option value="3c1342f6b38a46e39064bd88015df50d" label="Any" color="blue"></option></select></th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>number1</td><td>A static value or a variable path</td><td><span data-option="6a3ca9c830be4cd5a2bcf10d17c44f82">Number</span></td><td>true</td></tr><tr><td>number2</td><td>A static value or a variable path</td><td><span data-option="6a3ca9c830be4cd5a2bcf10d17c44f82">Number</span></td><td>true</td></tr></tbody></table>

**Returns**

&#x20; ([*Boolean*](/legacy-documentation/data-and-variables/data-types#booleans)*)*

**Example**

{% tabs %}
{% tab title="Template" %}
{{#if ($lt score 50) }}Score is less than 50{{/if}}
{% endtab %}

{% tab title="Data" %}

```json
{
    "score": 25
}
```

{% endtab %}

{% tab title="Result" %}
Score is less than 50
{% endtab %}
{% endtabs %}

### gte

`{{$gte number1 number2}}`

Evaluates to `true` if `number1` is **greater than or equal to** `number2`.

**Arguments**

<table><thead><tr><th width="150">Name</th><th width="272.5333333333333">Description</th><th width="150">Type<select multiple><option value="b0403385da1b4af9a8a894cb7cfa1e88" label="String" color="blue"></option><option value="6a3ca9c830be4cd5a2bcf10d17c44f82" label="Number" color="blue"></option><option value="011b91dfe58a400894b04549ec4f9e02" label="Boolean" color="blue"></option><option value="3c1342f6b38a46e39064bd88015df50d" label="Any" color="blue"></option></select></th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>number1</td><td>A static value or a variable path</td><td><span data-option="6a3ca9c830be4cd5a2bcf10d17c44f82">Number</span></td><td>true</td></tr><tr><td>number2</td><td>A static value or a variable path</td><td><span data-option="6a3ca9c830be4cd5a2bcf10d17c44f82">Number</span></td><td>true</td></tr></tbody></table>

**Returns**

&#x20; *(*[*Boolean*](/legacy-documentation/data-and-variables/data-types#booleans)*)*

**Example**

{% tabs %}
{% tab title="Template" %}
{{#if ($gte score 50) }}Score is greater than or equal to 50{{/if}}
{% endtab %}

{% tab title="Data" %}

```json
{
    "score": 50
}
```

{% endtab %}

{% tab title="Result" %}
Score is greater than or equal to 50
{% endtab %}
{% endtabs %}

### lte

`{{$lte number1 number2}}`

Evaluates to `true` if `number1` is **less than or equal to** `number2`.

**Arguments**

<table><thead><tr><th width="150">Name</th><th width="272.5333333333333">Description</th><th width="150">Type<select multiple><option value="b0403385da1b4af9a8a894cb7cfa1e88" label="String" color="blue"></option><option value="6a3ca9c830be4cd5a2bcf10d17c44f82" label="Number" color="blue"></option><option value="011b91dfe58a400894b04549ec4f9e02" label="Boolean" color="blue"></option><option value="3c1342f6b38a46e39064bd88015df50d" label="Any" color="blue"></option></select></th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>number1</td><td>A static value or a variable path</td><td><span data-option="6a3ca9c830be4cd5a2bcf10d17c44f82">Number</span></td><td>true</td></tr><tr><td>number2</td><td>A static value or a variable path</td><td><span data-option="6a3ca9c830be4cd5a2bcf10d17c44f82">Number</span></td><td>true</td></tr></tbody></table>

**Returns**

&#x20; *(*[*Boolean*](/legacy-documentation/data-and-variables/data-types#booleans)*)*

**Example**

{% tabs %}
{% tab title="Template" %}
{{#if ($lte score 50) }}Score is less than or equal to 50{{/if}}
{% endtab %}

{% tab title="Data" %}

```json
{
    "score":50
}
```

{% endtab %}

{% tab title="Result" %}
Content to display for sports
{% endtab %}
{% endtabs %}


# Identity Operators

### isNull

`{{$isNull value}}`

Evaluates to `true` if `value` is null.

**Arguments**

<table><thead><tr><th width="150">Name</th><th width="272.5333333333333">Description</th><th width="150">Type<select multiple><option value="b0403385da1b4af9a8a894cb7cfa1e88" label="String" color="blue"></option><option value="6a3ca9c830be4cd5a2bcf10d17c44f82" label="Number" color="blue"></option><option value="011b91dfe58a400894b04549ec4f9e02" label="Boolean" color="blue"></option><option value="3c1342f6b38a46e39064bd88015df50d" label="Any" color="blue"></option><option value="331ed19046194ceda3a4dc3fc0789b8f" label="" color="blue"></option></select></th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>value</td><td>A static value or a variable path</td><td><span data-option="3c1342f6b38a46e39064bd88015df50d">Any</span></td><td>true</td></tr></tbody></table>

**Returns**

&#x20; *(*[*Boolean*](/legacy-documentation/data-and-variables/data-types#booleans)*)*

**Example**

{% tabs %}
{% tab title="Template" %}
{{#if ($isNull category) }}Category is null{{/if}}
{% endtab %}

{% tab title="Data" %}

```json
{
    "category": null
}
```

{% endtab %}

{% tab title="Result" %}
Category is null
{% endtab %}
{% endtabs %}

### isNotNull&#x20;

`{{$isNotNull value}}`

Evaluates to `true` if `value` **is not null**.

**Arguments**

<table><thead><tr><th width="150">Name</th><th width="272.5333333333333">Description</th><th width="150">Type<select multiple><option value="b0403385da1b4af9a8a894cb7cfa1e88" label="String" color="blue"></option><option value="6a3ca9c830be4cd5a2bcf10d17c44f82" label="Number" color="blue"></option><option value="011b91dfe58a400894b04549ec4f9e02" label="Boolean" color="blue"></option><option value="3c1342f6b38a46e39064bd88015df50d" label="Any" color="blue"></option><option value="331ed19046194ceda3a4dc3fc0789b8f" label="" color="blue"></option></select></th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>value</td><td>A static value or a variable path</td><td><span data-option="3c1342f6b38a46e39064bd88015df50d">Any</span></td><td>true</td></tr></tbody></table>

**Returns**

&#x20; *(*[*Boolean*](/legacy-documentation/data-and-variables/data-types#booleans)*)*

**Example**

{% tabs %}
{% tab title="Template" %}
{{#if ($isNotNull category) }}Category is not null{{/if}}
{% endtab %}

{% tab title="Data" %}

```json
{
    "category": "sports"
}
```

{% endtab %}

{% tab title="Result" %}
Category is
{% endtab %}
{% endtabs %}

### isNil

`{{$isNil value}}`

Evaluates to `true` if `value` is `null` or `undefined` .

**Arguments**

<table><thead><tr><th width="150">Name</th><th width="272.5333333333333">Description</th><th width="150">Type<select multiple><option value="b0403385da1b4af9a8a894cb7cfa1e88" label="String" color="blue"></option><option value="6a3ca9c830be4cd5a2bcf10d17c44f82" label="Number" color="blue"></option><option value="011b91dfe58a400894b04549ec4f9e02" label="Boolean" color="blue"></option><option value="3c1342f6b38a46e39064bd88015df50d" label="Any" color="blue"></option><option value="331ed19046194ceda3a4dc3fc0789b8f" label="" color="blue"></option></select></th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>value</td><td>A static value or a variable path</td><td><span data-option="3c1342f6b38a46e39064bd88015df50d">Any</span></td><td>true</td></tr></tbody></table>

**Returns**

&#x20; *(*[*Boolean*](/legacy-documentation/data-and-variables/data-types#booleans)*)*

**Example**

{% tabs %}
{% tab title="Template" %}
{{#if ($isNil category) }}Category is nil{{/if}}
{% endtab %}

{% tab title="Data" %}

```json
{
    "category":null
}
```

{% endtab %}

{% tab title="Result" %}
Category is nil
{% endtab %}
{% endtabs %}

### isNotNil&#x20;

`{{$isNotNil value}}`

Evaluates to `true` if `value` is not `null` or `undefined`.

**Arguments**

<table><thead><tr><th width="150">Name</th><th width="272.5333333333333">Description</th><th width="150">Type<select multiple><option value="b0403385da1b4af9a8a894cb7cfa1e88" label="String" color="blue"></option><option value="6a3ca9c830be4cd5a2bcf10d17c44f82" label="Number" color="blue"></option><option value="011b91dfe58a400894b04549ec4f9e02" label="Boolean" color="blue"></option><option value="3c1342f6b38a46e39064bd88015df50d" label="Any" color="blue"></option><option value="331ed19046194ceda3a4dc3fc0789b8f" label="" color="blue"></option></select></th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>value</td><td>A static value or a variable path</td><td><span data-option="3c1342f6b38a46e39064bd88015df50d">Any</span></td><td>true</td></tr></tbody></table>

**Returns**

&#x20; *(*[*Boolean*](/legacy-documentation/data-and-variables/data-types#booleans)*)*

**Example**

{% tabs %}
{% tab title="Template" %}
{{#if ($isNotNil category) }}Category is not nil{{/if}}
{% endtab %}

{% tab title="Data" %}

```json
{
    "category":"sports"
}
```

{% endtab %}

{% tab title="Result" %}
Category is not nil
{% endtab %}
{% endtabs %}

### isEmpty

`{{$isEmpty path}}`

Evaluates to `true` if the value of the variable `path` *is* `undefined`, `null` , an empty string (`''`) , empty object (`{}`),  or an empty array (`[]`).

**Arguments**

<table><thead><tr><th width="150">Name</th><th width="272.5333333333333">Description</th><th width="150">Type<select multiple><option value="b0403385da1b4af9a8a894cb7cfa1e88" label="String" color="blue"></option><option value="6a3ca9c830be4cd5a2bcf10d17c44f82" label="Number" color="blue"></option><option value="011b91dfe58a400894b04549ec4f9e02" label="Boolean" color="blue"></option><option value="3c1342f6b38a46e39064bd88015df50d" label="Any" color="blue"></option><option value="331ed19046194ceda3a4dc3fc0789b8f" label="" color="blue"></option></select></th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>path</td><td>A path to a variable to check for a value</td><td><span data-option="3c1342f6b38a46e39064bd88015df50d">Any</span></td><td>true</td></tr></tbody></table>

**Returns**

&#x20; *(*[*Boolean*](/legacy-documentation/data-and-variables/data-types#booleans)*)*

**Example**

{% tabs %}
{% tab title="Template" %}
{{#if ($isEmpty category )}}Category is empty{{/if}}
{% endtab %}

{% tab title="Data" %}

```json
{
    "name":"soccer"
}
```

{% endtab %}

{% tab title="Result" %}
Category is empty
{% endtab %}
{% endtabs %}

### isNotEmpty

`{{$isNotEmpty value}}`

Evaluates to `true` if `value` *is not* `undefined`, `null`, an empty string (`''`),  an empty object (`{}`), and not an empty array (`[]`).

**Arguments**

<table><thead><tr><th width="150">Name</th><th width="272.5333333333333">Description</th><th width="150">Type<select multiple><option value="b0403385da1b4af9a8a894cb7cfa1e88" label="String" color="blue"></option><option value="6a3ca9c830be4cd5a2bcf10d17c44f82" label="Number" color="blue"></option><option value="011b91dfe58a400894b04549ec4f9e02" label="Boolean" color="blue"></option><option value="3c1342f6b38a46e39064bd88015df50d" label="Any" color="blue"></option><option value="331ed19046194ceda3a4dc3fc0789b8f" label="" color="blue"></option></select></th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>path</td><td>A path to a variable to check for a value</td><td><span data-option="3c1342f6b38a46e39064bd88015df50d">Any</span></td><td>true</td></tr></tbody></table>

**Returns**

&#x20; *(*[*Boolean*](/legacy-documentation/data-and-variables/data-types#booleans)*)*

**Example**

{% tabs %}
{% tab title="Template" %}
{{#if ($isNotEmpty category) }}Category is not empty{{/if}}
{% endtab %}

{% tab title="Data" %}

```json
{
    "category":"sports"
}
```

{% endtab %}

{% tab title="Result" %}
Category is not empty
{% endtab %}
{% endtabs %}


# Array Operators

### isIn

`{{$isIn value array}}`

Evaluates to true if `value` is in `array`.

**Arguments**

<table><thead><tr><th width="150">Name</th><th width="272.5333333333333">Description</th><th width="150">Type<select multiple><option value="b0403385da1b4af9a8a894cb7cfa1e88" label="String" color="blue"></option><option value="6a3ca9c830be4cd5a2bcf10d17c44f82" label="Number" color="blue"></option><option value="011b91dfe58a400894b04549ec4f9e02" label="Boolean" color="blue"></option><option value="3c1342f6b38a46e39064bd88015df50d" label="Any" color="blue"></option><option value="331ed19046194ceda3a4dc3fc0789b8f" label="String Array" color="blue"></option><option value="90054e941c4a42189f24f740853acb64" label="Number Array" color="blue"></option><option value="faca2fa5943441089b26f8f93d7d11a2" label="Boolean Array" color="blue"></option></select></th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>value</td><td>A static value or a variable path</td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String, </span><span data-option="6a3ca9c830be4cd5a2bcf10d17c44f82">Number, </span><span data-option="011b91dfe58a400894b04549ec4f9e02">Boolean</span></td><td>true</td></tr><tr><td>array</td><td>Array of values to check for <code>value</code></td><td><span data-option="331ed19046194ceda3a4dc3fc0789b8f">String Array, </span><span data-option="90054e941c4a42189f24f740853acb64">Number Array, </span><span data-option="faca2fa5943441089b26f8f93d7d11a2">Boolean Array</span></td><td>true</td></tr></tbody></table>

**Returns**

&#x20; *(*[*Boolean*](/legacy-documentation/data-and-variables/data-types#booleans)*)*

**Example**

{% tabs %}
{% tab title="Template" %}
{{#if ($isIn "sports" categories) }}Sports is in categories{{/if}}
{% endtab %}

{% tab title="Data" %}

```json
{
    "categories":[
        "sports",
        "entertainment",
        "news"
    ]
}
```

{% endtab %}

{% tab title="Result" %}
Sports is in categories
{% endtab %}
{% endtabs %}

### isNotIn&#x20;

`{{$isNotIn value array}}`

Evaluates to `true` if `value` **is not in** `array`.

**Arguments**

<table><thead><tr><th width="150">Name</th><th width="272.5333333333333">Description</th><th width="150">Type<select multiple><option value="b0403385da1b4af9a8a894cb7cfa1e88" label="String" color="blue"></option><option value="6a3ca9c830be4cd5a2bcf10d17c44f82" label="Number" color="blue"></option><option value="011b91dfe58a400894b04549ec4f9e02" label="Boolean" color="blue"></option><option value="3c1342f6b38a46e39064bd88015df50d" label="Any" color="blue"></option><option value="331ed19046194ceda3a4dc3fc0789b8f" label="String Array" color="blue"></option><option value="90054e941c4a42189f24f740853acb64" label="Number Array" color="blue"></option><option value="faca2fa5943441089b26f8f93d7d11a2" label="Boolean Array" color="blue"></option></select></th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>value</td><td>A static value or a variable path</td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String, </span><span data-option="6a3ca9c830be4cd5a2bcf10d17c44f82">Number, </span><span data-option="011b91dfe58a400894b04549ec4f9e02">Boolean</span></td><td>true</td></tr><tr><td>array</td><td>Array of values to check for <code>value</code></td><td><span data-option="331ed19046194ceda3a4dc3fc0789b8f">String Array, </span><span data-option="90054e941c4a42189f24f740853acb64">Number Array, </span><span data-option="faca2fa5943441089b26f8f93d7d11a2">Boolean Array</span></td><td>true</td></tr></tbody></table>

**Returns**

&#x20; *(*[*Boolean*](/legacy-documentation/data-and-variables/data-types#booleans)*)*

**Example**

{% tabs %}
{% tab title="Template" %}
{{#if ($isNotIn "sports" categories)}}Sports is not in categories{{/if}}
{% endtab %}

{% tab title="Data" %}

```json
{
    "categories":[
        "entertainment",
        "weather",
        "news"
    ]
}
```

{% endtab %}

{% tab title="Result" %}
Sports is not in categories
{% endtab %}
{% endtabs %}


# String Operators

### startsWith&#x20;

`{{$startsWith string1 string2}}`

Evaluates to `true` if `string1` starts with `string2`.

**Arguments**

<table><thead><tr><th width="150">Name</th><th width="272.5333333333333">Description</th><th width="150">Type<select multiple><option value="b0403385da1b4af9a8a894cb7cfa1e88" label="String" color="blue"></option><option value="6a3ca9c830be4cd5a2bcf10d17c44f82" label="Number" color="blue"></option><option value="011b91dfe58a400894b04549ec4f9e02" label="Boolean" color="blue"></option><option value="3c1342f6b38a46e39064bd88015df50d" label="Any" color="blue"></option><option value="331ed19046194ceda3a4dc3fc0789b8f" label="String Array" color="blue"></option><option value="90054e941c4a42189f24f740853acb64" label="Number Array" color="blue"></option><option value="faca2fa5943441089b26f8f93d7d11a2" label="Boolean Array" color="blue"></option></select></th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>string1</td><td>A static value or a variable path to check for <code>string2</code></td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String</span></td><td>true</td></tr><tr><td>string2</td><td>A static value or a variable path to check for in <code>string1</code></td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String</span></td><td>true</td></tr></tbody></table>

**Returns**

&#x20; *(*[*Boolean*](/legacy-documentation/data-and-variables/data-types#booleans)*)*

**Example**

{% tabs %}
{% tab title="Template" %}
{{#if ($startsWith movie "Bourne") }}Movie starts with Bourne{{/if}}
{% endtab %}

{% tab title="Data" %}

```json
{
    "movie":"Bourne Identity"
}
```

{% endtab %}

{% tab title="Result" %}
Movie starts with Bourne
{% endtab %}
{% endtabs %}

### endsWith&#x20;

`{{$endsWith string1 string2}}`

Evaluates to true if `string1` ends with `string2`.

**Arguments**

<table><thead><tr><th width="150">Name</th><th width="272.5333333333333">Description</th><th width="150">Type<select multiple><option value="b0403385da1b4af9a8a894cb7cfa1e88" label="String" color="blue"></option><option value="6a3ca9c830be4cd5a2bcf10d17c44f82" label="Number" color="blue"></option><option value="011b91dfe58a400894b04549ec4f9e02" label="Boolean" color="blue"></option><option value="3c1342f6b38a46e39064bd88015df50d" label="Any" color="blue"></option><option value="331ed19046194ceda3a4dc3fc0789b8f" label="String Array" color="blue"></option><option value="90054e941c4a42189f24f740853acb64" label="Number Array" color="blue"></option><option value="faca2fa5943441089b26f8f93d7d11a2" label="Boolean Array" color="blue"></option></select></th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>string1</td><td>A static value or a variable path to check for <code>string2</code></td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String</span></td><td>true</td></tr><tr><td>string2</td><td>A static value or a variable path to check for in <code>string1</code></td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String</span></td><td>true</td></tr></tbody></table>

**Returns**

&#x20; *(*[*Boolean*](/legacy-documentation/data-and-variables/data-types#booleans)*)*

**Example**

{% tabs %}
{% tab title="Template" %}
{{#if ($endsWith movie "Story") }}Movie ends with Story{{/if}}
{% endtab %}

{% tab title="Data" %}

```json
{
    "movie":"Toy Story"
}
```

{% endtab %}

{% tab title="Result" %}
Movie ends with Story
{% endtab %}
{% endtabs %}

### contains&#x20;

`{{$contains string1 string2}}`

Evaluates to true if `string1` exists in `string2`.

**Arguments**

<table><thead><tr><th width="150">Name</th><th width="272.5333333333333">Description</th><th width="150">Type<select multiple><option value="b0403385da1b4af9a8a894cb7cfa1e88" label="String" color="blue"></option><option value="6a3ca9c830be4cd5a2bcf10d17c44f82" label="Number" color="blue"></option><option value="011b91dfe58a400894b04549ec4f9e02" label="Boolean" color="blue"></option><option value="3c1342f6b38a46e39064bd88015df50d" label="Any" color="blue"></option><option value="331ed19046194ceda3a4dc3fc0789b8f" label="String Array" color="blue"></option><option value="90054e941c4a42189f24f740853acb64" label="Number Array" color="blue"></option><option value="faca2fa5943441089b26f8f93d7d11a2" label="Boolean Array" color="blue"></option></select></th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>string1</td><td>A static value or a variable path to check for <code>string2</code></td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String</span></td><td>true</td></tr><tr><td>string2</td><td>A static value or a variable path to check for in <code>string1</code></td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String</span></td><td>true</td></tr></tbody></table>

**Returns**

&#x20; *(*[*Boolean*](/legacy-documentation/data-and-variables/data-types#booleans)*)*

**Example**

{% tabs %}
{% tab title="Template" %}
{{#if ($contains movie "Bronx") }}Movie contains Bronx{{/if}}
{% endtab %}

{% tab title="Data" %}

```json
{
    "movie":"A Bronx Tale"
}
```

{% endtab %}

{% tab title="Result" %}
Movie contains Bronx
{% endtab %}
{% endtabs %}

### doesNotContain

`{{$doesNotContain string1 string2}}`

Evaluates to `true` if `string1` does not exist in `string2`.

**Arguments**

<table><thead><tr><th width="150">Name</th><th width="272.5333333333333">Description</th><th width="150">Type<select multiple><option value="b0403385da1b4af9a8a894cb7cfa1e88" label="String" color="blue"></option><option value="6a3ca9c830be4cd5a2bcf10d17c44f82" label="Number" color="blue"></option><option value="011b91dfe58a400894b04549ec4f9e02" label="Boolean" color="blue"></option><option value="3c1342f6b38a46e39064bd88015df50d" label="Any" color="blue"></option><option value="331ed19046194ceda3a4dc3fc0789b8f" label="String Array" color="blue"></option><option value="90054e941c4a42189f24f740853acb64" label="Number Array" color="blue"></option><option value="faca2fa5943441089b26f8f93d7d11a2" label="Boolean Array" color="blue"></option></select></th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>string1</td><td>A static value or a variable path to check for <code>string2</code></td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String</span></td><td>true</td></tr><tr><td>string2</td><td>A static value or a variable path to check for in <code>string1</code></td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String</span></td><td>true</td></tr></tbody></table>

**Returns**

&#x20; *(*[*Boolean*](/legacy-documentation/data-and-variables/data-types#booleans)*)*

**Example**

{% tabs %}
{% tab title="Template" %}
{{#if ($doesNotContian movie "Batman") }}Movie does not contain Batman{{/if}}
{% endtab %}

{% tab title="Data" %}

```json
{
    "movie":"The Dark Knight"
}
```

{% endtab %}

{% tab title="Result" %}
Movie does not contain Batman
{% endtab %}
{% endtabs %}

### matches

`{{$matches string expression}}`

Returns `true` if `string` matches a [regular expression](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions).

**Arguments**

<table><thead><tr><th width="141">Name</th><th width="272.5333333333333">Description</th><th width="150">Type<select multiple><option value="b0403385da1b4af9a8a894cb7cfa1e88" label="String" color="blue"></option><option value="6a3ca9c830be4cd5a2bcf10d17c44f82" label="Number" color="blue"></option><option value="011b91dfe58a400894b04549ec4f9e02" label="Boolean" color="blue"></option><option value="3c1342f6b38a46e39064bd88015df50d" label="Any" color="blue"></option><option value="331ed19046194ceda3a4dc3fc0789b8f" label="String Array" color="blue"></option><option value="90054e941c4a42189f24f740853acb64" label="Number Array" color="blue"></option><option value="faca2fa5943441089b26f8f93d7d11a2" label="Boolean Array" color="blue"></option></select></th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>string</td><td>A static value or a variable path to evaluate the regular expression against</td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String</span></td><td>true</td></tr><tr><td>expression</td><td>Regular expression to evaluate</td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String</span></td><td>true</td></tr></tbody></table>

**Returns**

&#x20; *(*[*Boolean*](/legacy-documentation/data-and-variables/data-types#booleans)*)*

**Example**

{% tabs %}
{% tab title="Template" %}
{{#if ($matches category "^spo.\*") }}Category matches regular expression{{/if}}
{% endtab %}

{% tab title="Data" %}

```
{
    "category":"sports"
}
```

{% endtab %}

{% tab title="Result" %}
Category matches regular expression
{% endtab %}
{% endtabs %}


# Logical Operators

Logical operators can be used in conjunction with `#if` statements and other operators to perform logical checks.

### and

`{{$and arg1 arg2 ...}}`

Returns `true` if all `arguments` evaluate to `true`

**Arguments**

<table><thead><tr><th width="152">Name</th><th width="272.5333333333333">Description</th><th width="150">Type<select multiple><option value="b0403385da1b4af9a8a894cb7cfa1e88" label="String" color="blue"></option><option value="6a3ca9c830be4cd5a2bcf10d17c44f82" label="Number" color="blue"></option><option value="011b91dfe58a400894b04549ec4f9e02" label="Boolean" color="blue"></option><option value="3c1342f6b38a46e39064bd88015df50d" label="Any" color="blue"></option><option value="331ed19046194ceda3a4dc3fc0789b8f" label="String Array" color="blue"></option><option value="90054e941c4a42189f24f740853acb64" label="Number Array" color="blue"></option><option value="faca2fa5943441089b26f8f93d7d11a2" label="Boolean Array" color="blue"></option></select></th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>arg1</td><td>1st argument to evaluate</td><td><span data-option="011b91dfe58a400894b04549ec4f9e02">Boolean</span></td><td>true</td></tr><tr><td>arg2</td><td>2nd argument to evaluate</td><td><span data-option="011b91dfe58a400894b04549ec4f9e02">Boolean</span></td><td>true</td></tr><tr><td>...</td><td>Remaining arguments to evaluate</td><td><span data-option="011b91dfe58a400894b04549ec4f9e02">Boolean</span></td><td>false</td></tr></tbody></table>

**Returns**

&#x20; *(*[*Boolean*](/legacy-documentation/data-and-variables/data-types#booleans)*)*

**Example**

This example checks if the `qty` is greater than 5 *and* the `amount` is less than 200

{% tabs %}
{% tab title="Template" %}
{{$and ($gt qty 5) ($lt amount 200) }}
{% endtab %}

{% tab title="Data" %}

```
{
    "amount": 150,
    "qty": 4
}
```

{% endtab %}

{% tab title="Result" %}
true
{% endtab %}
{% endtabs %}

### or

`{{$or arg1 arg2 ...}}`

Returns `true` if any of the `arguments` evaluate to `true`

**Arguments**

<table><thead><tr><th width="152">Name</th><th width="272.5333333333333">Description</th><th width="150">Type<select multiple><option value="b0403385da1b4af9a8a894cb7cfa1e88" label="String" color="blue"></option><option value="6a3ca9c830be4cd5a2bcf10d17c44f82" label="Number" color="blue"></option><option value="011b91dfe58a400894b04549ec4f9e02" label="Boolean" color="blue"></option><option value="3c1342f6b38a46e39064bd88015df50d" label="Any" color="blue"></option><option value="331ed19046194ceda3a4dc3fc0789b8f" label="String Array" color="blue"></option><option value="90054e941c4a42189f24f740853acb64" label="Number Array" color="blue"></option><option value="faca2fa5943441089b26f8f93d7d11a2" label="Boolean Array" color="blue"></option></select></th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>arg1</td><td>1st argument to evaluate</td><td><span data-option="011b91dfe58a400894b04549ec4f9e02">Boolean</span></td><td>true</td></tr><tr><td>arg2</td><td>2nd argument to evaluate</td><td><span data-option="011b91dfe58a400894b04549ec4f9e02">Boolean</span></td><td>true</td></tr><tr><td>...</td><td>Remaining arguments to evaluate</td><td><span data-option="011b91dfe58a400894b04549ec4f9e02">Boolean</span></td><td>false</td></tr></tbody></table>

**Returns**

&#x20; *(*[*Boolean*](/legacy-documentation/data-and-variables/data-types#booleans)*)*

**Example**

This example checks if the `qty` is greater than 5 *or* the `amount` is less than 200

{% tabs %}
{% tab title="Template" %}
{{$or ($gt qty 5) ($lt amount 200) }}
{% endtab %}

{% tab title="Data" %}

```
{
    "amount": 500,
    "qty": 4
}
```

{% endtab %}

{% tab title="Result" %}
true
{% endtab %}
{% endtabs %}


# Legacy Formatting

Format variables the way you want them to look

{% hint style="danger" %}
Most formatting can be done in the settings for the Fields Token. This is mainly used for formatting that is not yet supported in the Fields Token UI.
{% endhint %}

## Number

{% content-ref url="/pages/WJ97cHH4HPft3Nnu57cw" %}
[Number](/templates/working-with-dynamic-data/legacy-formatting/number)
{% endcontent-ref %}

## Date/Time

{% content-ref url="/pages/pBdAOTp74Q27MvIEksJG" %}
[Date & Time](/templates/working-with-dynamic-data/legacy-formatting/date-and-time)
{% endcontent-ref %}

## Text

{% content-ref url="/pages/a9MAUpJEcJJmRhRVsRD9" %}
[$md](/templates/working-with-dynamic-data/functions-and-operators/functions/content/usdmd)
{% endcontent-ref %}


# Number

To format numbers, use the `$number` format function:&#x20;

{% embed url="<https://www.youtube.com/watch?v=WBOvxcoUSMY>" %}

![](/files/kpYQ4mjR89u3XRVfXXEx)

**Variable Name:** the name of your variable that will contain the value to be formatted.\
**Format String:** the text code that tells Documint how to would like to format the value

#### General

### $number <a href="#var" id="var"></a>

Used for applying custom formatting to numbers.

#### Signature

`{{$number value format_string [locale]}}`

#### Arguments

<table><thead><tr><th width="150">Name</th><th width="235.5333333333333">Description</th><th width="150">Type<select multiple><option value="b0403385da1b4af9a8a894cb7cfa1e88" label="String" color="blue"></option><option value="6a3ca9c830be4cd5a2bcf10d17c44f82" label="Number" color="blue"></option><option value="011b91dfe58a400894b04549ec4f9e02" label="Boolean" color="blue"></option><option value="3c1342f6b38a46e39064bd88015df50d" label="Any" color="blue"></option></select></th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>value</td><td>Name of variable to be formatted</td><td><span data-option="6a3ca9c830be4cd5a2bcf10d17c44f82">Number</span></td><td>true</td></tr><tr><td>format_string</td><td>Pattern for formatting variable. <a href="#standard">See guide below</a></td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String</span></td><td>true</td></tr><tr><td>locale</td><td>Specify which locale to use for formatting currencies. <a href="#currency">See list below</a></td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String</span></td><td>false</td></tr><tr><td>default=</td><td>Default value to display when value is blank. Default=''</td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String, </span><span data-option="6a3ca9c830be4cd5a2bcf10d17c44f82">Number</span></td><td>false</td></tr></tbody></table>

#### Returns

Formatted number

#### **Example #1 - Basic**

```
// given qty_sold is 1250
{{$number qty_sold "0,0"}} // 1,250
```

#### Example #2 - With Default

```javascript
// given qty_sold is blank
{{$number qty_sold "0,0" default="0"}} // 0
```

### Standard

| Value    | Format String | Result |
| -------- | ------------- | ------ |
| <p>10000 |               |        |

</p><p></p><p></p> | "0,0.0000"     | 10,000.0000   |
| 10000.23                      | "0,0"          | 10,000        |
| 10000.23                      | "+0,0"         | +10,000       |
| -10000                        | "0,0.0"        | -10,000.0     |
| 10000.1234                    | '0.000'        | 10000.123     |
| 100.1234                      | "00000"        | 00100         |
| 1000.1234                     | "000000,0"     | 001,000       |
| 10                            | "000.00"       | 010.00        |
| 10000.1234                    | "0\[.]00000"   | 10000.12340   |
| -10000                        | "(0,0.0000)"   | (10,000.0000) |
| -0.23                         | ".00"          | -.23          |
| -0.23                         | "(.00)"        | (.23)         |
| 0.23                          | "0.00000"      | 0.23000       |
| 0.23                          | "0.0\[0000]"   | 0.23          |
| 1230974                       | "0.0a"         | 1.2m          |
| 1460                          | "0 a"          | 1 k           |
| -104000                       | "0a"           | -104k         |
| 1                             | "0o"           | 1st           |
| 100	                          | "0o"           | 100th         |

### Currency

{% tabs %}
{% tab title="Formats" %}
**Example:**

```javascript
// given grand_total is 1800
{{$number grand_total "$0,0.00"}} // $1,800.00
```

| Number       | Format String | String     |
| ------------ | ------------- | ---------- |
| 1000.234     | '$0,0.00'     | $1,000.23  |
| 1000.2       | '0,0\[.]00 $' | 1,000.20 $ |
| 1001         | '$ 0,0\[.]00' | $ 1,001    |
| -1000.234    | '($0,0)'      | ($1,000)   |
| -1000.234    | '$0.00'       | -$1000.23  |
| 1230974      | '($ 0.00 a)'  | $ 1.23 m   |
| {% endtab %} |               |            |

{% tab title="Locales" %}
You can set the locale using the locale code as the third argument.

#### Example

```javascript
// grand_total = 15000
{{$number grand_total "$0,0.00" "en-gb"}} 
// Result: £15,000.00
```

#### Reference

| Name                   | **Code**   |          Example |
| ---------------------- | ---------- | ---------------: |
| United States          | \[default] |        $1,000.00 |
| Bulgarian              | bg         |       лв1 000,00 |
| Chinese (Simplified)   | chs        |        ¥1,000.00 |
| Czech                  | cs         |       Kč1 000,00 |
| Danish (Denmark)       | da-dk      | DKK1.000,00&#xD; |
| German (Switzerland)   | de-ch      |      CHF1 000,00 |
| German                 | de         |        €1 000,00 |
| English (Australia)    | en-au      |        $1,000.00 |
| English (UK)           | en-gb      |        £1,000.00 |
| English (South Africa) | en-za      |        R1 000,00 |
| Spanish (Spain)        | es-es      |        €1.000,00 |
| Spanish                | es         |        $1.000,00 |
| Estonian               | et         |        €1 000,00 |
| Finnish                | fi         |        €1 000,00 |
| French (Canada)        | fr-ca      |        $1 000,00 |
| French (Switzerland)   | fr-ch      |      CHF1'000.00 |
| French                 | fr         |        €1 000,00 |
| Hungarian              | hu         |       Ft1 000,00 |
| Italian                | it         |        €1.000,00 |
| Japanese               | ja         |        ¥1,000.00 |
| Latvian                | lv         |        €1 000,00 |
| Dutch (Belgium)        | nl-be      |       € 1 000,00 |
| Dutch (Netherlands)    | nl-nl      |       € 1.000,00 |
| Norwegian              | no         |       kr1 000,00 |
| Polish                 | pl         |      PLN1 000,00 |
| Portuguese (Brazil)    | pt-br      |       R$1.000,00 |
| Portuguese             | pt-pt      |        €1 000,00 |
| Russian (Ukraine)      | ru-ua      |        ₴1 000,00 |
| Russian                | ru         |     руб.1 000,00 |
| Slovak                 | sk         |        €1 000,00 |
| Slovenian              | sl         |        €1.000,00 |
| Thai                   | th         |        ฿1,000.00 |
| Turkish                | tr         |        ₺1.000,00 |
| Ukrainian (Ukraine)    | uk-ua      |        ₴1 000,00 |
| Vietnam                | vi         |        ₫1.000,00 |

{% endtab %}

{% tab title="Custom Locale" %}
Create custom locales using the following syntax:

#### Example

```javascript
// grand_total = 15000
{{$number grand_total "0,0.0$" s="$U" t="," d="." }}
// Result: 15,000.00$U
```

#### Reference

| Name                       | Code | Default Value |
| -------------------------- | :--: | :-----------: |
| Currency **S**ymbol        |  `s` |      `$`      |
| **T**housands Separator    |  `t` |      `,`      |
| **D**ecimal                |  `d` |      `.`      |
| **Th**ousands Abbreviation | `th` |      `k`      |
| **Mi**llions Abbreviation  | `mi` |      `m`      |
| **Bi**llions Abbreviation  | `bi` |      `b`      |
| **Tr**illions Abbreviation | `tr` |      `t`      |
| {% endtab %}               |      |               |
| {% endtabs %}              |      |               |

### Percentage

| Number      | Format String | String   |
| ----------- | ------------- | -------- |
| 1           | '0%'          | 100%     |
| 0.974878234 | '0.000%'      | 97.488%  |
| -0.43       | '0 %'         | -43 %    |
| 0.43        | '(0.000 %)'   | 43.000 % |

### Duration

| Number | Format String | String   |
| ------ | ------------- | -------- |
| 25     | '00:00:00'    | 0:00:25  |
| 238    | '00:00:00'    | 0:03:58  |
| 63846  | '00:00:00'    | 17:44:06 |

Source:[ numeral.js](http://numeraljs.com/)


# Date & Time

To format dates, use the `$date` format function:

{% embed url="<https://youtu.be/LGBAtZxoivo>" %}

![](/files/2VWd5quiHTXBGG0fn7qe)

**Example**

```javascript
// given invoice_date is "2021-05-18T20:05:07Z"
{{$date invoice_date "MM/DD/YYYY h:mm a"}} // 05/18/2021 8:05 pm
```

### Standard

{% tabs %}
{% tab title="Formats" %}

| Description                    | Token              | Output                                                                                                                                                                                                                                                                                                                                     |
| ------------------------------ | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Month**                      | M                  | 1 2 ... 11 12                                                                                                                                                                                                                                                                                                                              |
|                                | Mo                 | 1st 2nd ... 11th 12th                                                                                                                                                                                                                                                                                                                      |
|                                | MM                 | 01 02 ... 11 12                                                                                                                                                                                                                                                                                                                            |
|                                | MMM                | Jan Feb ... Nov Dec                                                                                                                                                                                                                                                                                                                        |
|                                | MMMM               | January February ... November December                                                                                                                                                                                                                                                                                                     |
| **Quarter**                    | Q                  | 1 2 3 4                                                                                                                                                                                                                                                                                                                                    |
|                                | Qo                 | 1st 2nd 3rd 4th                                                                                                                                                                                                                                                                                                                            |
| **Day of Month**               | D                  | 1 2 ... 30 31                                                                                                                                                                                                                                                                                                                              |
|                                | Do                 | 1st 2nd ... 30th 31st                                                                                                                                                                                                                                                                                                                      |
|                                | DD                 | 01 02 ... 30 31                                                                                                                                                                                                                                                                                                                            |
| **Day of Year**                | DDD                | 1 2 ... 364 365                                                                                                                                                                                                                                                                                                                            |
|                                | DDDo               | 1st 2nd ... 364th 365th                                                                                                                                                                                                                                                                                                                    |
|                                | DDDD               | 001 002 ... 364 365                                                                                                                                                                                                                                                                                                                        |
| **Day of Week**                | d                  | 0 1 ... 5 6                                                                                                                                                                                                                                                                                                                                |
|                                | do                 | 0th 1st ... 5th 6th                                                                                                                                                                                                                                                                                                                        |
|                                | dd                 | Su Mo ... Fr Sa                                                                                                                                                                                                                                                                                                                            |
|                                | ddd                | Sun Mon ... Fri Sat                                                                                                                                                                                                                                                                                                                        |
|                                | dddd               | Sunday Monday ... Friday Saturday                                                                                                                                                                                                                                                                                                          |
| **Day of Week (Locale)**       | e                  | 0 1 ... 5 6                                                                                                                                                                                                                                                                                                                                |
| **Day of Week (ISO)**          | E                  | 1 2 ... 6 7                                                                                                                                                                                                                                                                                                                                |
| **Week of Year**               | w                  | 1 2 ... 52 53                                                                                                                                                                                                                                                                                                                              |
|                                | wo                 | 1st 2nd ... 52nd 53rd                                                                                                                                                                                                                                                                                                                      |
|                                | ww                 | 01 02 ... 52 53                                                                                                                                                                                                                                                                                                                            |
| **Week of Year (ISO)**         | W                  | 1 2 ... 52 53                                                                                                                                                                                                                                                                                                                              |
|                                | Wo                 | 1st 2nd ... 52nd 53rd                                                                                                                                                                                                                                                                                                                      |
|                                | WW                 | 01 02 ... 52 53                                                                                                                                                                                                                                                                                                                            |
| **Year**                       | YY                 | 70 71 ... 29 30                                                                                                                                                                                                                                                                                                                            |
|                                | YYYY               | 1970 1971 ... 2029 2030                                                                                                                                                                                                                                                                                                                    |
|                                | YYYYYY             | <p>-001970 -001971 ... +001907 +001971<br><strong>Note:</strong> <a href="https://tc39.es/ecma262/#sec-expanded-years">Expanded Years</a> (Covering the full time value range of approximately 273,790 years forward or backward from 01 January, 1970)</p>                                                                                |
|                                | Y                  | <p>1970 1971 ... 9999 +10000 +10001<br><strong>Note:</strong> This complies with the ISO 8601 standard for dates past the year 9999</p>                                                                                                                                                                                                    |
| **Era Year**                   | y                  | 1 2 ... 2020 ...                                                                                                                                                                                                                                                                                                                           |
| **Era**                        | N, NN, NNN         | <p>BC AD<br><strong>Note:</strong> Abbr era name</p>                                                                                                                                                                                                                                                                                       |
|                                | NNNN               | <p>Before Christ, Anno Domini<br><strong>Note:</strong> Full era name</p>                                                                                                                                                                                                                                                                  |
|                                | NNNNN              | <p>BC AD<br><strong>Note:</strong> Narrow era name</p>                                                                                                                                                                                                                                                                                     |
| **Week Year**                  | gg                 | 70 71 ... 29 30                                                                                                                                                                                                                                                                                                                            |
|                                | gggg               | 1970 1971 ... 2029 2030                                                                                                                                                                                                                                                                                                                    |
| **Week Year (ISO)**            | GG                 | 70 71 ... 29 30                                                                                                                                                                                                                                                                                                                            |
|                                | GGGG               | 1970 1971 ... 2029 2030                                                                                                                                                                                                                                                                                                                    |
| **AM/PM**                      | A                  | AM PM                                                                                                                                                                                                                                                                                                                                      |
|                                | a                  | am pm                                                                                                                                                                                                                                                                                                                                      |
| **Hour**                       | H                  | 0 1 ... 22 23                                                                                                                                                                                                                                                                                                                              |
|                                | HH                 | 00 01 ... 22 23                                                                                                                                                                                                                                                                                                                            |
|                                | h                  | 1 2 ... 11 12                                                                                                                                                                                                                                                                                                                              |
|                                | hh                 | 01 02 ... 11 12                                                                                                                                                                                                                                                                                                                            |
|                                | k                  | 1 2 ... 23 24                                                                                                                                                                                                                                                                                                                              |
|                                | kk                 | 01 02 ... 23 24                                                                                                                                                                                                                                                                                                                            |
| **Minute**                     | m                  | 0 1 ... 58 59                                                                                                                                                                                                                                                                                                                              |
|                                | mm                 | 00 01 ... 58 59                                                                                                                                                                                                                                                                                                                            |
| **Second**                     | s                  | 0 1 ... 58 59                                                                                                                                                                                                                                                                                                                              |
|                                | ss                 | 00 01 ... 58 59                                                                                                                                                                                                                                                                                                                            |
| **Fractional Second**          | S                  | 0 1 ... 8 9                                                                                                                                                                                                                                                                                                                                |
|                                | SS                 | 00 01 ... 98 99                                                                                                                                                                                                                                                                                                                            |
|                                | SSS                | 000 001 ... 998 999                                                                                                                                                                                                                                                                                                                        |
|                                | SSSS ... SSSSSSSSS | 000\[0..] 001\[0..] ... 998\[0..] 999\[0..]                                                                                                                                                                                                                                                                                                |
| **Time Zone**                  | z or zz            | <p>EST CST ... MST PST<br><strong>Note:</strong> as of <strong>1.6.0</strong>, the z/zz format tokens have been deprecated from plain moment objects. <a href="https://github.com/moment/moment/issues/162">Read more about it here.</a> However, they *do* work if you are using a specific time zone with the moment-timezone addon.</p> |
|                                | Z                  | -07:00 -06:00 ... +06:00 +07:00                                                                                                                                                                                                                                                                                                            |
|                                | ZZ                 | -0700 -0600 ... +0600 +0700                                                                                                                                                                                                                                                                                                                |
| **Unix Timestamp**             | X                  | 1360013296                                                                                                                                                                                                                                                                                                                                 |
| **Unix Millisecond Timestamp** | x                  | 1360013296123                                                                                                                                                                                                                                                                                                                              |

Source:[ moment.js](https://momentjs.com/docs/#/displaying/format/)
{% endtab %}

{% tab title="Timezones" %}
Specify the timezone by adding `tz="<timezone name>"` to the date formatter like so:

```javascript
{{$date date_created "MM/DD/YYYY h:mm a" tz="America/New_York"}}
```

| Timezone Names                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <ul><li>Africa/Abidjan</li><li>Africa/Accra</li><li>Africa/Addis\_Ababa</li><li>Africa/Algiers</li><li>Africa/Asmara</li><li>Africa/Asmera</li><li>Africa/Bamako</li><li>Africa/Bangui</li><li>Africa/Banjul</li><li>Africa/Bissau</li><li>Africa/Blantyre</li><li>Africa/Brazzaville</li><li>Africa/Bujumbura</li><li>Africa/Cairo</li><li>Africa/Casablanca</li><li>Africa/Ceuta</li><li>Africa/Conakry</li><li>Africa/Dakar</li><li>Africa/Dar\_es\_Salaam</li><li>Africa/Djibouti</li><li>Africa/Douala</li><li>Africa/El\_Aaiun</li><li>Africa/Freetown</li><li>Africa/Gaborone</li><li>Africa/Harare</li><li>Africa/Johannesburg</li><li>Africa/Juba</li><li>Africa/Kampala</li><li>Africa/Khartoum</li><li>Africa/Kigali</li><li>Africa/Kinshasa</li><li>Africa/Lagos</li><li>Africa/Libreville</li><li>Africa/Lome</li><li>Africa/Luanda</li><li>Africa/Lubumbashi</li><li>Africa/Lusaka</li><li>Africa/Malabo</li><li>Africa/Maputo</li><li>Africa/Maseru</li><li>Africa/Mbabane</li><li>Africa/Mogadishu</li><li>Africa/Monrovia</li><li>Africa/Nairobi</li><li>Africa/Ndjamena</li><li>Africa/Niamey</li><li>Africa/Nouakchott</li><li>Africa/Ouagadougou</li><li>Africa/Porto-Novo</li><li>Africa/Sao\_Tome</li><li>Africa/Timbuktu</li><li>Africa/Tripoli</li><li>Africa/Tunis</li><li>Africa/Windhoek</li><li>America/Adak</li><li>America/Anchorage</li><li>America/Anguilla</li><li>America/Antigua</li><li>America/Araguaina</li><li>America/Argentina/Buenos\_Aires</li><li>America/Argentina/Catamarca</li><li>America/Argentina/ComodRivadavia</li><li>America/Argentina/Cordoba</li><li>America/Argentina/Jujuy</li><li>America/Argentina/La\_Rioja</li><li>America/Argentina/Mendoza</li><li>America/Argentina/Rio\_Gallegos</li><li>America/Argentina/Salta</li><li>America/Argentina/San\_Juan</li><li>America/Argentina/San\_Luis</li><li>America/Argentina/Tucuman</li><li>America/Argentina/Ushuaia</li><li>America/Aruba</li><li>America/Asuncion</li><li>America/Atikokan</li><li>America/Atka</li><li>America/Bahia</li><li>America/Bahia\_Banderas</li><li>America/Barbados</li><li>America/Belem</li><li>America/Belize</li><li>America/Blanc-Sablon</li><li>America/Boa\_Vista</li><li>America/Bogota</li><li>America/Boise</li><li>America/Buenos\_Aires</li><li>America/Cambridge\_Bay</li><li>America/Campo\_Grande</li><li>America/Cancun</li><li>America/Caracas</li><li>America/Catamarca</li><li>America/Cayenne</li><li>America/Cayman</li><li>America/Chicago</li><li>America/Chihuahua</li><li>America/Coral\_Harbour</li><li>America/Cordoba</li><li>America/Costa\_Rica</li><li>America/Creston</li><li>America/Cuiaba</li><li>America/Curacao</li><li>America/Danmarkshavn</li><li>America/Dawson</li><li>America/Dawson\_Creek</li><li>America/Denver</li><li>America/Detroit</li><li>America/Dominica</li><li>America/Edmonton</li><li>America/Eirunepe</li><li>America/El\_Salvador</li><li>America/Ensenada</li><li>America/Fort\_Nelson</li><li>America/Fort\_Wayne</li><li>America/Fortaleza</li><li>America/Glace\_Bay</li><li>America/Godthab</li><li>America/Goose\_Bay</li><li>America/Grand\_Turk</li><li>America/Grenada</li><li>America/Guadeloupe</li><li>America/Guatemala</li><li>America/Guayaquil</li><li>America/Guyana</li><li>America/Halifax</li><li>America/Havana</li><li>America/Hermosillo</li><li>America/Indiana/Indianapolis</li><li>America/Indiana/Knox</li><li>America/Indiana/Marengo</li><li>America/Indiana/Petersburg</li><li>America/Indiana/Tell\_City</li><li>America/Indiana/Vevay</li><li>America/Indiana/Vincennes</li><li>America/Indiana/Winamac</li><li>America/Indianapolis</li><li>America/Inuvik</li><li>America/Iqaluit</li><li>America/Jamaica</li><li>America/Jujuy</li><li>America/Juneau</li><li>America/Kentucky/Louisville</li><li>America/Kentucky/Monticello</li><li>America/Knox\_IN</li><li>America/Kralendijk</li><li>America/La\_Paz</li><li>America/Lima</li><li>America/Los\_Angeles</li><li>America/Louisville</li><li>America/Lower\_Princes</li><li>America/Maceio</li><li>America/Managua</li><li>America/Manaus</li><li>America/Marigot</li><li>America/Martinique</li><li>America/Matamoros</li><li>America/Mazatlan</li><li>America/Mendoza</li><li>America/Menominee</li><li>America/Merida</li><li>America/Metlakatla</li><li>America/Mexico\_City</li><li>America/Miquelon</li><li>America/Moncton</li><li>America/Monterrey</li><li>America/Montevideo</li><li>America/Montreal</li><li>America/Montserrat</li><li>America/Nassau</li><li>America/New\_York</li><li>America/Nipigon</li><li>America/Nome</li><li>America/Noronha</li><li>America/North\_Dakota/Beulah</li><li>America/North\_Dakota/Center</li><li>America/North\_Dakota/New\_Salem</li><li>America/Nuuk</li><li>America/Ojinaga</li><li>America/Panama</li><li>America/Pangnirtung</li><li>America/Paramaribo</li><li>America/Phoenix</li><li>America/Port-au-Prince</li><li>America/Port\_of\_Spain</li><li>America/Porto\_Acre</li><li>America/Porto\_Velho</li><li>America/Puerto\_Rico</li><li>America/Punta\_Arenas</li><li>America/Rainy\_River</li><li>America/Rankin\_Inlet</li><li>America/Recife</li><li>America/Regina</li><li>America/Resolute</li><li>America/Rio\_Branco</li><li>America/Rosario</li><li>America/Santa\_Isabel</li><li>America/Santarem</li><li>America/Santiago</li><li>America/Santo\_Domingo</li><li>America/Sao\_Paulo</li><li>America/Scoresbysund</li></ul> | <p></p><ul><li>America/Shiprock</li><li>America/Sitka</li><li>America/St\_Barthelemy</li><li>America/St\_Johns</li><li>America/St\_Kitts</li><li>America/St\_Lucia</li><li>America/St\_Thomas</li><li>America/St\_Vincent</li><li>America/Swift\_Current</li><li>America/Tegucigalpa</li><li>America/Thule</li><li>America/Thunder\_Bay</li><li>America/Tijuana</li><li>America/Toronto</li><li>America/Tortola</li><li>America/Vancouver</li><li>America/Virgin</li><li>America/Whitehorse</li><li>America/Winnipeg</li><li>America/Yakutat</li><li>America/Yellowknife</li><li>Antarctica/Casey</li><li>Antarctica/Davis</li><li>Antarctica/DumontDUrville</li><li>Antarctica/Macquarie</li><li>Antarctica/Mawson</li><li>Antarctica/McMurdo</li><li>Antarctica/Palmer</li><li>Antarctica/Rothera</li><li>Antarctica/South\_Pole</li><li>Antarctica/Syowa</li><li>Antarctica/Troll</li><li>Antarctica/Vostok</li><li>Arctic/Longyearbyen</li><li>Asia/Aden</li><li>Asia/Almaty</li><li>Asia/Amman</li><li>Asia/Anadyr</li><li>Asia/Aqtau</li><li>Asia/Aqtobe</li><li>Asia/Ashgabat</li><li>Asia/Ashkhabad</li><li>Asia/Atyrau</li><li>Asia/Baghdad</li><li>Asia/Bahrain</li><li>Asia/Baku</li><li>Asia/Bangkok</li><li>Asia/Barnaul</li><li>Asia/Beirut</li><li>Asia/Bishkek</li><li>Asia/Brunei</li><li>Asia/Calcutta</li><li>Asia/Chita</li><li>Asia/Choibalsan</li><li>Asia/Chongqing</li><li>Asia/Chungking</li><li>Asia/Colombo</li><li>Asia/Dacca</li><li>Asia/Damascus</li><li>Asia/Dhaka</li><li>Asia/Dili</li><li>Asia/Dubai</li><li>Asia/Dushanbe</li><li>Asia/Famagusta</li><li>Asia/Gaza</li><li>Asia/Harbin</li><li>Asia/Hebron</li><li>Asia/Ho\_Chi\_Minh</li><li>Asia/Hong\_Kong</li><li>Asia/Hovd</li><li>Asia/Irkutsk</li><li>Asia/Istanbul</li><li>Asia/Jakarta</li><li>Asia/Jayapura</li><li>Asia/Jerusalem</li><li>Asia/Kabul</li><li>Asia/Kamchatka</li><li>Asia/Karachi</li><li>Asia/Kashgar</li><li>Asia/Kathmandu</li><li>Asia/Katmandu</li><li>Asia/Khandyga</li><li>Asia/Kolkata</li><li>Asia/Krasnoyarsk</li><li>Asia/Kuala\_Lumpur</li><li>Asia/Kuching</li><li>Asia/Kuwait</li><li>Asia/Macao</li><li>Asia/Macau</li><li>Asia/Magadan</li><li>Asia/Makassar</li><li>Asia/Manila</li><li>Asia/Muscat</li><li>Asia/Nicosia</li><li>Asia/Novokuznetsk</li><li>Asia/Novosibirsk</li><li>Asia/Omsk</li><li>Asia/Oral</li><li>Asia/Phnom\_Penh</li><li>Asia/Pontianak</li><li>Asia/Pyongyang</li><li>Asia/Qatar</li><li>Asia/Qostanay</li><li>Asia/Qyzylorda</li><li>Asia/Rangoon</li><li>Asia/Riyadh</li><li>Asia/Saigon</li><li>Asia/Sakhalin</li><li>Asia/Samarkand</li><li>Asia/Seoul</li><li>Asia/Shanghai</li><li>Asia/Singapore</li><li>Asia/Srednekolymsk</li><li>Asia/Taipei</li><li>Asia/Tashkent</li><li>Asia/Tbilisi</li><li>Asia/Tehran</li><li>Asia/Tel\_Aviv</li><li>Asia/Thimbu</li><li>Asia/Thimphu</li><li>Asia/Tokyo</li><li>Asia/Tomsk</li><li>Asia/Ujung\_Pandang</li><li>Asia/Ulaanbaatar</li><li>Asia/Ulan\_Bator</li><li>Asia/Urumqi</li><li>Asia/Ust-Nera</li><li>Asia/Vientiane</li><li>Asia/Vladivostok</li><li>Asia/Yakutsk</li><li>Asia/Yangon</li><li>Asia/Yekaterinburg</li><li>Asia/Yerevan</li><li>Atlantic/Azores</li><li>Atlantic/Bermuda</li><li>Atlantic/Canary</li><li>Atlantic/Cape\_Verde</li><li>Atlantic/Faeroe</li><li>Atlantic/Faroe</li><li>Atlantic/Jan\_Mayen</li><li>Atlantic/Madeira</li><li>Atlantic/Reykjavik</li><li>Atlantic/South\_Georgia</li><li>Atlantic/St\_Helena</li><li>Atlantic/Stanley</li><li>Australia/ACT</li><li>Australia/Adelaide</li><li>Australia/Brisbane</li><li>Australia/Broken\_Hill</li><li>Australia/Canberra</li><li>Australia/Currie</li><li>Australia/Darwin</li><li>Australia/Eucla</li><li>Australia/Hobart</li><li>Australia/LHI</li><li>Australia/Lindeman</li><li>Australia/Lord\_Howe</li><li>Australia/Melbourne</li><li>Australia/NSW</li><li>Australia/North</li><li>Australia/Perth</li><li>Australia/Queensland</li><li>Australia/South</li><li>Australia/Sydney</li><li>Australia/Tasmania</li><li>Australia/Victoria</li><li>Australia/West</li><li>Australia/Yancowinna</li><li>Brazil/Acre</li><li>Brazil/DeNoronha</li><li>Brazil/East</li><li>Brazil/West</li><li>CET</li><li>CST6CDT</li><li>Canada/Atlantic</li><li>Canada/Central</li><li>Canada/Eastern</li><li>Canada/Mountain</li><li>Canada/Newfoundland</li><li>Canada/Pacific</li><li>Canada/Saskatchewan</li><li>Canada/Yukon</li><li>Chile/Continental</li><li>Chile/EasterIsland</li><li>Cuba</li><li>EET</li><li>EST</li><li>EST5EDT</li><li>Egypt</li><li>Eire</li><li>Etc/GMT</li><li>Etc/GMT+0</li><li>Etc/GMT+1</li><li>Etc/GMT+10</li><li>Etc/GMT+11</li><li>Etc/GMT+12</li><li>Etc/GMT+2</li><li>Etc/GMT+3</li><li>Etc/GMT+4</li><li>Etc/GMT+5</li></ul> | <p></p><ul><li>Etc/GMT+6</li><li>Etc/GMT+7</li><li>Etc/GMT+8</li><li>Etc/GMT+9</li><li>Etc/GMT-0</li><li>Etc/GMT-1</li><li>Etc/GMT-10</li><li>Etc/GMT-11</li><li>Etc/GMT-12</li><li>Etc/GMT-13</li><li>Etc/GMT-14</li><li>Etc/GMT-2</li><li>Etc/GMT-3</li><li>Etc/GMT-4</li><li>Etc/GMT-5</li><li>Etc/GMT-6</li><li>Etc/GMT-7</li><li>Etc/GMT-8</li><li>Etc/GMT-9</li><li>Etc/GMT0</li><li>Etc/Greenwich</li><li>Etc/UCT</li><li>Etc/UTC</li><li>Etc/Universal</li><li>Etc/Zulu</li><li>Europe/Amsterdam</li><li>Europe/Andorra</li><li>Europe/Astrakhan</li><li>Europe/Athens</li><li>Europe/Belfast</li><li>Europe/Belgrade</li><li>Europe/Berlin</li><li>Europe/Bratislava</li><li>Europe/Brussels</li><li>Europe/Bucharest</li><li>Europe/Budapest</li><li>Europe/Busingen</li><li>Europe/Chisinau</li><li>Europe/Copenhagen</li><li>Europe/Dublin</li><li>Europe/Gibraltar</li><li>Europe/Guernsey</li><li>Europe/Helsinki</li><li>Europe/Isle\_of\_Man</li><li>Europe/Istanbul</li><li>Europe/Jersey</li><li>Europe/Kaliningrad</li><li>Europe/Kiev</li><li>Europe/Kirov</li><li>Europe/Lisbon</li><li>Europe/Ljubljana</li><li>Europe/London</li><li>Europe/Luxembourg</li><li>Europe/Madrid</li><li>Europe/Malta</li><li>Europe/Mariehamn</li><li>Europe/Minsk</li><li>Europe/Monaco</li><li>Europe/Moscow</li><li>Europe/Nicosia</li><li>Europe/Oslo</li><li>Europe/Paris</li><li>Europe/Podgorica</li><li>Europe/Prague</li><li>Europe/Riga</li><li>Europe/Rome</li><li>Europe/Samara</li><li>Europe/San\_Marino</li><li>Europe/Sarajevo</li><li>Europe/Saratov</li><li>Europe/Simferopol</li><li>Europe/Skopje</li><li>Europe/Sofia</li><li>Europe/Stockholm</li><li>Europe/Tallinn</li><li>Europe/Tirane</li><li>Europe/Tiraspol</li><li>Europe/Ulyanovsk</li><li>Europe/Uzhgorod</li><li>Europe/Vaduz</li><li>Europe/Vatican</li><li>Europe/Vienna</li><li>Europe/Vilnius</li><li>Europe/Volgograd</li><li>Europe/Warsaw</li><li>Europe/Zagreb</li><li>Europe/Zaporozhye</li><li>Europe/Zurich</li><li>GB</li><li>GB-Eire</li><li>GMT</li><li>GMT+0</li><li>GMT-0</li><li>GMT0</li><li>Greenwich</li><li>HST</li><li>Hongkong</li><li>Iceland</li><li>Indian/Antananarivo</li><li>Indian/Chagos</li><li>Indian/Christmas</li><li>Indian/Cocos</li><li>Indian/Comoro</li><li>Indian/Kerguelen</li><li>Indian/Mahe</li><li>Indian/Maldives</li><li>Indian/Mauritius</li><li>Indian/Mayotte</li><li>Indian/Reunion</li><li>Iran</li><li>Israel</li><li>Jamaica</li><li>Japan</li><li>Kwajalein</li><li>Libya</li><li>MET</li><li>MST</li><li>MST7MDT</li><li>Mexico/BajaNorte</li><li>Mexico/BajaSur</li><li>Mexico/General</li><li>NZ</li><li>NZ-CHAT</li><li>Navajo</li><li>PRC</li><li>PST8PDT</li><li>Pacific/Apia</li><li>Pacific/Auckland</li><li>Pacific/Bougainville</li><li>Pacific/Chatham</li><li>Pacific/Chuuk</li><li>Pacific/Easter</li><li>Pacific/Efate</li><li>Pacific/Enderbury</li><li>Pacific/Fakaofo</li><li>Pacific/Fiji</li><li>Pacific/Funafuti</li><li>Pacific/Galapagos</li><li>Pacific/Gambier</li><li>Pacific/Guadalcanal</li><li>Pacific/Guam</li><li>Pacific/Honolulu</li><li>Pacific/Johnston</li><li>Pacific/Kiritimati</li><li>Pacific/Kosrae</li><li>Pacific/Kwajalein</li><li>Pacific/Majuro</li><li>Pacific/Marquesas</li><li>Pacific/Midway</li><li>Pacific/Nauru</li><li>Pacific/Niue</li><li>Pacific/Norfolk</li><li>Pacific/Noumea</li><li>Pacific/Pago\_Pago</li><li>Pacific/Palau</li><li>Pacific/Pitcairn</li><li>Pacific/Pohnpei</li><li>Pacific/Ponape</li><li>Pacific/Port\_Moresby</li><li>Pacific/Rarotonga</li><li>Pacific/Saipan</li><li>Pacific/Samoa</li><li>Pacific/Tahiti</li><li>Pacific/Tarawa</li><li>Pacific/Tongatapu</li><li>Pacific/Truk</li><li>Pacific/Wake</li><li>Pacific/Wallis</li><li>Pacific/Yap</li><li>Poland</li><li>Portugal</li><li>ROC</li><li>ROK</li><li>Singapore</li><li>Turkey</li><li>UCT</li><li>US/Alaska</li><li>US/Aleutian</li><li>US/Arizona</li><li>US/Central</li><li>US/East-Indiana</li><li>US/Eastern</li><li>US/Hawaii</li><li>US/Indiana-Starke</li><li>US/Michigan</li><li>US/Mountain</li><li>US/Pacific</li><li>US/Samoa</li><li>UTC</li><li>Universal</li><li>W-SU</li><li>WET</li><li>Zulu</li></ul> |
| {% endtab %}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| {% endtabs %}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |

### Current Date/Time

To add the current date/time use the Date formatter with the format property set.

#### Example

```
{{$date format="MM/DD/YYYY"}}
```


# HubSpot

### Overview

HubSpot is a versatile platform offering a suite of tools for inbound marketing, sales, and customer service.&#x20;

Key features include a robust CRM system for managing customer interactions, marketing automation for efficient campaign management, a Sales Hub for pipeline management and engagement tracking, a Service Hub for exceptional customer support, a user-friendly Content Management System, and comprehensive analytics and reporting tools.&#x20;

These integrated features make HubSpot ideal for businesses aiming to streamline operations and enhance customer engagement.

### Requirements

1. Hubspot account (<https://www.hubspot.com/>)
2. Documint account

You can get started with free accounts for both and then upgrade as you need.

### Integration

With the power of Documint PDF creation, you can seamlessly generate documents with one click!&#x20;

The Documint app integrates with your Hubspot account and allows all your HubSpot users to access the templates created in your Documint account, so you'll only need one Documint account to serve your whole team.&#x20;

The Documint app can access data for the following objects:

* **Contacts**
* **Companies**
* **Deals**
* **Tickets**
* **Custom objects**

{% hint style="info" %}
While the Documint extension can access your custom object data, you can not launch the Documint extension from a custom object record. See [Working with Custom Object Data](/integrations/hubspot/working-with-custom-object-data).
{% endhint %}

You can find the [Documint app](https://app.hubspot.com/ecosystem/7888327/marketplace/apps/documint) in the Hubspot app marketplace.

<figure><img src="/files/azaEZhte8RAPIsqaWKmq" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/0p1cGcGjKuVr3BOr1CP6" alt=""><figcaption></figcaption></figure>

Let's get started installing and setting up you Documint extension.


# Installing the Documint app

Simply click the link below to get to the Documint app in the HubSpot app marketplace.

Take me to the [Documint HubSpot App](https://app-eu1.hubspot.com/ecosystem/143734752/marketplace/apps/productivity/project-management/documint)

You will see the information page with a button to install.&#x20;

Go ahead and click that to get started.

<figure><img src="/files/RICCt2FBGMQ7Kwaw0c9m" alt=""><figcaption></figcaption></figure>

You'll need to choose the account you would like to connect to the Documint app.

<figure><img src="/files/8avOBL1aDdbcrLPbAU6O" alt=""><figcaption></figcaption></figure>

Agree to the permissions needed and click **Connect app.**

<figure><img src="/files/3jm7a0OF5584hvJABvP9" alt=""><figcaption></figcaption></figure>

You'll be taken to a confirmation page. Congrats 🎊&#x20;

You have completed the Documint app installation.

<figure><img src="/files/JG2t1f5RpNG1eXsut0hV" alt=""><figcaption></figcaption></figure>

Navigate to any record in **Contact, Companies, Tickets, or Deals**, and you'll see the app is installed.

#### Launching the Documint App

To launch the Documint app, navigate to any record in **Contact, Companies, Deals, or Tickets** and press the "create document" button in the bottom right corner of the page.

<figure><img src="/files/omvZTCyJdoR7up3jWocC" alt=""><figcaption></figcaption></figure>

Now let's connect your Documint account to the app.


# Connecting your Documint account

To connect your Documint account to your newly installed HubSpot app, we need to add an API key from your Documint account. Here's how:

#### Create your API key

Go to your Documint account and find **Integrations** on the left-hand panel. Then click the **Create API key** button

<figure><img src="/files/BPiKe37aa3rNyLZrXIUv" alt=""><figcaption></figcaption></figure>

Give your key a name and click **Create**

<figure><img src="/files/4pIfXHHQbZP38PE9vNFo" alt=""><figcaption></figcaption></figure>

Copy your API key to use in HubSpot

<figure><img src="/files/dOJnAbcgfYo8Krlk7m7l" alt=""><figcaption></figcaption></figure>

#### Paste your key into HubSpot

Go to the gear icon in the top right of your HubSpot window, go to **Integrations**, then **Connected Apps**

<figure><img src="/files/BLFwVKeC3NcQoSRnMVru" alt=""><figcaption></figcaption></figure>

Go to **Documint**

<figure><img src="/files/MGXdkIw1bDUyUda47GDQ" alt=""><figcaption></figcaption></figure>

Click on **General settings** and then **Add/Edit API Key** button

<figure><img src="/files/rrGOrazv00nnOnTtomxb" alt=""><figcaption></figcaption></figure>

This will bring up a window for you to paste your API key into. Paste it in and save

<figure><img src="/files/CrczuVwnJS5pW3i6vyf6" alt=""><figcaption></figcaption></figure>

You are now all connected to your Documint account! 🎊

{% hint style="info" %}
PLEASE NOTE - You can use this same method if you ever need or want to update or replace the API key for your Documint account
{% endhint %}


# Navigating the Documint App

Once you[ launch](/integrations/hubspot/installing-the-documint-app#launching-the-documint-app) the Documint app, you will be brought to the app's dashboard where you will see an overlay prompting you to select a template. Pick the template you would like to use to proceed.

{% hint style="info" %}
Please note: the Documint app will not show templates that are connected to a data source.
{% endhint %}

<figure><img src="/files/9Y7v8SZUYuqiN8mJD3fV" alt=""><figcaption></figcaption></figure>

This is the dashboard. Here you will be able to select a record, change your template, view your document preview, and generate your document among other things.

<figure><img src="/files/ncZCkKLNDoBCXBA0aIeM" alt=""><figcaption></figcaption></figure>

#### Changing your record

By default, the Documint app launches with the record from which you launched it as the selected record. You can change the selected record by clicking on the "change" label that is near the record controls at the top of the dashboard.

Clicking on change will open an overlay from which you can select your record. You can also see records for different object types by switching the current object type with the dropdown in the top left corner of the overlay.

<figure><img src="/files/3qwzSgGLUQEsyU3j6k94" alt=""><figcaption><p>The record selection overlay also provides tools to search and filter records.</p></figcaption></figure>


# Working with Custom Object Data

The Documint app can only [launch](/integrations/hubspot/installing-the-documint-app#launching-the-documint-app) from **Contacts, Companies, Deals, or Tickets**, so if you would like to work with custom objects, you will need to switch records **within** the Documint app.

First launch the app from a contact, company, deal or ticket and select the template you would like to use.&#x20;

Once in the dashboard, click on the "change" label that is in the record controls at the top of the dashboard. That will open a record selection overlay.&#x20;

<figure><img src="/files/Mk2xWipM7OPssi1U1HMx" alt=""><figcaption></figcaption></figure>

In the record selection overlay you can switch to your custom object (or any object type for that matter) with the object type dropdown in the top left corner.

<figure><img src="/files/WhggL2bswswLbQCrQUbI" alt=""><figcaption></figcaption></figure>

Now you will see a new list of records for your selected object type. Pick the one you want to use, and you will return to the document view.

<figure><img src="/files/RMBdYEh1xnY3L19mK1YL" alt=""><figcaption></figcaption></figure>

Next, let's add some variables to your template.


# Adding HubSpot Properties to Your Template

Hubspot records contain data as properties and these properties are used to retrieve and display your data. Each property is a key-value pair. The key is an identifier shared by all records that contain that property. The value is the value unique to that specific record. So, all records of a particular object type will have the same keys (e.g. contacts will having "lastname", "firstname", "email", etc.), but their values will be unique (e.g. "John", "Rachel", "Andrew", etc.).\
\
In order to get your Hubspot data to merge with your Documint templates you will need to find the property names (keys) and paste them into your template. The Documint Hubspot extension contains an easy table where you can see and copy all your record's properties.

The Documint app can access property data for these objects:

* **Contacts**
* **Companies**
* **Deals**
* **Tickets**
* **Custom Objects**

## Viewing Properties

To search and view the available properties, just click the **View Properties** button near the bottom of the dashboard.

<figure><img src="/files/5NJHqrOrpmWmnnn2yEqY" alt=""><figcaption></figcaption></figure>

You can filter and view all properties for your object as well as the properties for associated objects.

<figure><img src="/files/IzR9F3BTFaity0DKl3cv" alt=""><figcaption><p>The properties table also show the properties' types and group identifiers as well as if they are custom or Hubspot defined</p></figcaption></figure>

## Primary properties

Primary properties are properties that belong to the object type that is currently selected.&#x20;

{% hint style="info" %}
See [Working with Custom Object Data](/integrations/hubspot/working-with-custom-object-data) on how to change the selected object.
{% endhint %}

Copy a proprety by highlighting it and pressing "Ctrl+C". Then paste it into your template.

<figure><img src="/files/p9fw8Of7H4QnOWwrKIvY" alt=""><figcaption><p>Copy a token.</p></figcaption></figure>

<figure><img src="/files/HXCWS5HsJgtF1CdlgnID" alt=""><figcaption><p>Paste it!</p></figcaption></figure>

1. Open the schema
2. Add a field
3. Paste the property
4. Delete the curly braces
5. Save it
6. Drag the token to the template

[Learn more](/templates/working-with-dynamic-data/fields-editor) <mark style="color:$info;">(fields editor)</mark>

## Association properties

Association properties are the properties of associated objects. For example, your selected object is contacts and its associations are contacts (other contacts), companies, deals, and tickets.&#x20;

Because associations are lists/arrays of data for related records (see [array data type](/legacy-documentation/data-and-variables/data-types#arrays)), you can either display the values for associations by looping over each record, or you can just display data for a singe record from the list (This is useful when an associations list only contains a single associated record).&#x20;

{% hint style="info" %}
The Documint app does not currently provide association data for custom objects.
{% endhint %}

## Displaying values for Associations' Lists

To display values from an associated list, let's start with the schema.

1. Create a collection field

<figure><img src="/files/ekkpsPLQVvi3DOEt6czf" alt="" width="563"><figcaption></figcaption></figure>

2. Its name will be the name associated list in [snake case](https://developer.mozilla.org/en-US/docs/Glossary/Snake_case) format

| List       | Field Name  |
| ---------- | ----------- |
| Line Items | line\_items |
| Companies  | companies   |
| Contacts   | contacts    |
| Deals      | deals       |
| Tickets    | tickets     |

In this example, we will use Line Items

<figure><img src="/files/XKgYQkiOMYIEjj2zO4ID" alt="" width="563"><figcaption></figcaption></figure>

3. Go to the properties in HubSpot and access that list. In Use Type, select 'All items'. Copy the property associated with that list

<figure><img src="/files/on6bRf1ZoynW1z0bPTCS" alt=""><figcaption></figcaption></figure>

3. In the schema, click on 'Add Collection Field', paste the property, and delete the curly braces

<figure><img src="/files/0GK7ZudJJKzXfB1TpCvv" alt="" width="563"><figcaption></figcaption></figure>

4. Don't forget to check its field type. In this case, it's a number

<figure><img src="/files/BYD2ZpUNVe1OzZ5zbnYH" alt="" width="563"><figcaption></figcaption></figure>

5. Save the chema

<figure><img src="/files/peTKdu6G5MuYmnBvZQTG" alt="" width="563"><figcaption></figcaption></figure>

{% hint style="warning" %}
For each associated list, you'll need to create a separate collection
{% endhint %}

{% hint style="info" %}
Adding only the fields you are going to use on the template will be best to manage
{% endhint %}

### Single Value

If you'd like to display values from a single record, here is how it's done:

1. Place the token on your template and double-click it

<figure><img src="/files/tKkvQbdogLzZ82o5xKpp" alt=""><figcaption></figcaption></figure>

2. On Edit Token, in the 'return type' section, you'll be able to select the position of the item in that list you want to display. By default, it will display the first one

<figure><img src="/files/2nmg3dit5EXpxU3Setb7" alt=""><figcaption></figcaption></figure>

3. But if you want to display an item in another position, just select custom from the dropdown options and inform its index

<figure><img src="/files/1JHAR1tBprAmUhLFKfFq" alt=""><figcaption></figcaption></figure>

Essentially, to display only the first item, you'll just need to drag the template from that list into the template builder.&#x20;

### All values

You can also display all items in the associated list. For that, you'll need to set up a loop.&#x20;

First, drag the tokens into the template

<figure><img src="/files/CydbwcjLgWjZNoETlMlB" alt=""><figcaption></figcaption></figure>

In your Documint template, select the parent element that will be repeated for each item in the list, then click "Edit logic"

<figure><img src="/files/M6fW49Sq3ouQ6Q3xOToh" alt=""><figcaption></figcaption></figure>

Select the associated list name from the List Field dropdown.

<figure><img src="/files/A6JYwscylvXdImXqKTpA" alt="" width="563"><figcaption></figcaption></figure>

You're all set to generate your document!


# Adjust Template Settings

You can access some template settings right from your Documint HubSpot app without needing to change anything in your Documint account.

You can:

* Change the Name of the template
* Set the pattern for the saved file name, including adding variable data
* Set your template to **Active**
* Adjust margins

To access the setting click on the gear icon in the template preview window whilst in **Editor Mode**

<figure><img src="/files/df0jiK3GZqttHdCFMLrf" alt=""><figcaption></figcaption></figure>

Make your adjustments and don't forget to click **Save**

<figure><img src="/files/HQxfnoS0jGBuTT3pREOp" alt=""><figcaption></figcaption></figure>


# Generating Your documents

Now you're ready to start creating documents from your HubSpot data using the Documint app.

It's super simple.

1. Choose your template

<figure><img src="/files/9Y7v8SZUYuqiN8mJD3fV" alt=""><figcaption></figcaption></figure>

2. Choose you record

<figure><img src="/files/Sy1b9FNtfwrujYo16qw2" alt=""><figcaption></figcaption></figure>

3. Inspect the document preview and click **Generate Document**

<figure><img src="/files/YWFFlHzt1VIZej9yEjTq" alt=""><figcaption></figcaption></figure>

4. After a moment you will get a message to tell you your new document has been generated and saved to the Notes section of your record.

<figure><img src="/files/Df0vwh2qAWXtddim43ts" alt=""><figcaption></figcaption></figure>

You can close the app to see the new activity in **Notes** (You may need to refresh the page first). The attachment will be saved, and it will also be in the **Attachments** section on the right-hand side of the page.

<figure><img src="/files/KuN69eCRbQ0nR5SZ5SKQ" alt=""><figcaption></figcaption></figure>

You can now access this file to view, download, or do whatever you want with it.&#x20;

Congrats you're all set🎊


# Using Quick-Create

The quick-create feature allows you to quickly preview and create documents without launching the Documint app.

#### How it works

The Documint extension card contains a list of up to 5 of your most recently used templates (see below on how you can add specific templates to the card) from which you can quickly create or preview your document.

<figure><img src="/files/1Xoas4T9Gf7rwwiwEIaJ" alt="placeholder"><figcaption></figcaption></figure>

When you click on either preview or create, a new window will open to display the template.

If you are creating a document, wait for the success message to appear to confirm your document has been attached and then you can close the window.

<figure><img src="/files/nO3RV0btkwS7eLe799gb" alt=""><figcaption></figcaption></figure>

#### Picking your templates

By default, your most recently used templates are stored and will be the templates in the Documint card; however, you can select the templates you would like to appear for each object type in the app's settings.

In the HubSpot dashboard, go to settings > Integrations > Connected apps > Documint > Actions > Go to settings > Pick templates. This will open a frame with the template picker tool.

The template picker will allow you to select up to 5 templates for each object type. Once you are finished picking your templates, close the frame and refresh your record. You will now see your selected templates in the Documint card.

<figure><img src="/files/LVDpQg3b79RKFOJYBR75" alt=""><figcaption><p>The template picker is a simple drag-and-drop tool</p></figcaption></figure>

#### Going back to the default behavior

If you would like to go back to seeing your most recently used templates: go to the template picker tool, select your object type, and click reset. This will clear your selected templates and recently used templates will start to be stored instead.


# Using Workflows to Create Your Documents

If you have the appropriate HubSpot subscription you can use the Documint custom[ workflow action](https://knowledge.hubspot.com/workflows/choose-your-workflow-actions) to create your documents automatically using the [**Workflows** ](https://knowledge.hubspot.com/workflows/create-workflows)feature in HubSpot.&#x20;

{% hint style="info" %}
The Documint custom workflow action does not currently apply to custom objects.
{% endhint %}

You will need a **Sales, Service, Marketing or Operations Hub Professional** HubSpot account subscription to use the **Workflows** feature. You will also need to have the automations scope enabled for your app.

#### Setting up your workflow

Go to the HubSpot workflow area and create a workflow that is either contact, company, deal, or ticket based.

<figure><img src="/files/Mwmuq5GTfI8SLKIqgmp8" alt=""><figcaption></figcaption></figure>

Select a trigger.

<figure><img src="/files/MOXexlTKCIPZzyJNqsjC" alt=""><figcaption></figcaption></figure>

When you add an action, you will see the Documint custom workflow action. In the action you will select the template you want to use as well as the properties you want to send to populate the document (e.g. 'firstname', 'email', 'domain', etc.).

<figure><img src="/files/XGkykkfcp9i3HijQdeX1" alt=""><figcaption></figcaption></figure>

Review and publish your new workflow.

Now your documents will be generated automatically in the background and saved to your record in the **Notes** area.

#### Updating scopes for the Documint app

If your workflow is not saving documents to your record, a likely cause is that the Documint app does not include the required "automation" scope.

You can fix this by re-authorizing the app. From the HubSpot dashboard, go to settings > Integrations > Connected apps > Documint > Actions > Go to settings > Authorize. This will open a frame requiring you to authorize the Documint app.&#x20;

<figure><img src="/files/1awtBVAO9XWsMfai2ZDg" alt=""><figcaption></figcaption></figure>

If this does not fix the issue, please contact Documint support.


# Troubleshooting the Documint App

This section provides solutions for addressing some of the most common problems you might face when using the Documint app.

#### Workflows errors

The Documint app provides a custom workflow action that allows you create documents with your enrolled objects when a workflows is triggered. The created document is stored in a note in your record.&#x20;

If your document is not being attached, the most likely cause is that the Documint app does not include the required "automation" scope.&#x20;

You can fix this by re-authorizing the app. From the HubSpot dashboard, go to settings > Integrations > Connected apps > Documint > Actions > Go to settings > Authorize. This will open a frame requiring you to authorize the Documint app.&#x20;

<figure><img src="/files/1awtBVAO9XWsMfai2ZDg" alt=""><figcaption></figcaption></figure>

If this does not solve the problem, it could indicate a deeper problem.&#x20;

You can find more information on the error by inspecting the record's enrollment history logs. In the "action succeeded" section (action succeeded just means that HubSpot successfully made a request for the Documint action. It does not necessarily mean the action itself was successful) you will find the response error message.

<figure><img src="/files/iPbrZYe1pGUyAteSpFwC" alt=""><figcaption></figcaption></figure>

Share the error response with Documint support for a speedy resolution.

#### Documint card not showing up wiith custom objects

Due to limitations with HubSpot application development, CRM cards can not apply to custom objects. For information on how to work with custom objects in the Documint extension, see [Working with Custom Object Data](/integrations/hubspot/working-with-custom-object-data).&#x20;

#### Slow document rendering

Document rendering time in Documint can increase not only with template size but also due to several other important factors, particularly when working with the HubSpot extension.

A significant performance factor is the management of associated records. The app retrieves these records in batches of 100 from HubSpot, meaning that even one additional record over this threshold (101 records) would trigger an extra request. Additionally, each different type of associated object requires its own separate request to HubSpot.

To optimize performance, we recommend auditing your record associations. If you find unnecessary or outdated associations that have accumulated over time, removing them can significantly improve rendering speed. This is especially important when dealing with both large quantities of associations and diverse object types.


# Uninstalling the Documint App

You can uninstall the Documint app in two simple steps:

**Step 1: Disconnect HubSpot from Documint**

Disconnecting HubSpot from Documint is done by removing the API key which was created to communicate with HubSpot.

This is done through Settings > Integrations > API Keys > Delete

<figure><img src="https://lh7-us.googleusercontent.com/T5A7_4S1gB5LQ1xgso5nY-AZf6ee6CFPS8oQf5pMPVxZq_sPaynu9hgGvCHnKRtD5gW_dqmEvus6w4gae-a_6VJ7dcJ7XSz-dKNh78A_wBwRaOnlqPFiX4M8Dv9E3PSzD0XZhhKOgWOQ2Pri_3blUlg" alt=""><figcaption><p>Delete clicking the trashbin icon</p></figcaption></figure>

<figure><img src="/files/d82nfERXR9xYRXMyQOuF" alt="" width="375"><figcaption><p>Confirm by clicking "Delete permanently"</p></figcaption></figure>

**Step 2: Uninstall Documint app from your HubSpot portal**

To disconnect Documint from HubSpot, from HubSpot settings go to: Integrations > Connected Apps > Actions > Uninstall

<figure><img src="https://lh7-us.googleusercontent.com/y-Baw6c7LJkpfnVZeco6Ydk1-yzTu0WCGzOVGNz2GrTNaJgk7f155TFPj2xD8UOse4gUNaZv244GEeXkEZn33ePM97bTvuteiIytKQQE0XtwjtR7oFlaY99gbFAuJcQLt0dmpwHrMFqcC-ye8vuNeJg" alt="" width="375"><figcaption><p>Choose "Actions"</p></figcaption></figure>

<figure><img src="https://lh7-us.googleusercontent.com/DJRrAJYIk1NPhBZ5IKPhF_PlL5gngQT7b9anxPzsCRIbaPQRTgggS9CwREU-sR9MJOnON2qFR6rStPso9qC3Ovjign8mcn9vRna3kazi5bvWF_nxgkKsJkvsEUJ9WG9isoYbQux9p0sOgz8Fn1NpQvE" alt="" width="188"><figcaption><p>Choose "Uninstall"</p></figcaption></figure>

<figure><img src="https://lh7-us.googleusercontent.com/Fe-ALZEyOFGJwzFfM7EoIm-z8qQfBkxFd5yJADYRx-ixte6ntjupPFvddMVKP6rRe4CCR9tlaodgat6nVhaCIyeaJvaMma53i0NTBTe87oVPG2-mH8EYZKdbzX7acyZHdLaebDtHD5dhes-TAo2yYRQ" alt="" width="375"><figcaption><p>If prompted, confirm by typing "uninstall" in the box</p></figcaption></figure>

You have now disconnected Documint and HubSpot and removed Documint from your HubSpot portal.

**Impact of disconnecting and uninstalling**

Disconnecting HubSpot from Documint (by removing the API keys in Documint), terminates the dataflow between the two platforms.

\
Uninstalling the Documint app from HubSpot removes the application, its settings, and its connection to Documint.&#x20;

**Don't worry**. Your generated documents remain in HubSpot and deleting the app does not affect them.


# Airtable

### Overview

There are three types of Airtable integrations.&#x20;

1. [Native App](/integrations/airtable/airtable-extension)
2. [Generation Link](/integrations/airtable/generation-link)
3. [Automation Script](/integrations/airtable/automation-script)

All integrations allow you to create documents from your Airtable data and attach them back to Airtable. The Generation Link integration and the Automation Script are identical in their features however, the Native App does have some slight differences (see comparison below).&#x20;

### Integration Comparison

<table><thead><tr><th width="355.33333333333326">Feature</th><th width="150" align="center">Native App</th><th align="center">Generation Link + Automation Script</th></tr></thead><tbody><tr><td>Available with all Documint Plans</td><td align="center"><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span></td><td align="center"><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span></td></tr><tr><td>Available with all Airtable plans</td><td align="center"><span data-gb-custom-inline data-tag="emoji" data-code="274c">❌</span></td><td align="center"><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span></td></tr><tr><td>Attach documents back to Airtable</td><td align="center"><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span></td><td align="center"><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span></td></tr><tr><td>Include data from Linked Records</td><td align="center"><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span></td><td align="center"><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span></td></tr><tr><td>Document Preview</td><td align="center"><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span></td><td align="center"><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span></td></tr><tr><td>Works outside of Airtable (eg. Stacker)</td><td align="center"><span data-gb-custom-inline data-tag="emoji" data-code="274c">❌</span></td><td align="center"><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span></td></tr><tr><td>Shareable Document Link</td><td align="center"><span data-gb-custom-inline data-tag="emoji" data-code="274c">❌</span></td><td align="center"><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span></td></tr><tr><td>Whitelabel Document Viewer</td><td align="center"><span data-gb-custom-inline data-tag="emoji" data-code="274c">❌</span></td><td align="center"><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span></td></tr><tr><td>Document Password Protection</td><td align="center"><span data-gb-custom-inline data-tag="emoji" data-code="274c">❌</span></td><td align="center"><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span></td></tr><tr><td>Duplicate Document Prevention  </td><td align="center"><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span></td><td align="center"><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span></td></tr><tr><td>Setup time/difficulty</td><td align="center">😁</td><td align="center">🙂</td></tr></tbody></table>

### [Airtable App](/integrations/airtable/airtable-extension)

The Native App integration works by using an Airtable app that you can install in your base. You can find the app in the [Airtable Marketplace](https://airtable.com/marketplace/blkTK0uVJlZrho1Bu/documint). The app provides you with an interface within Airtable for generating documents from your records. [Learn more ](/integrations/airtable/airtable-extension)

### [Generation Link](/integrations/airtable/generation-link)

The Generation Link integration uses a special URL to generate your document. This URL is created dynamically by a formula in either a Formula field or Button field. When the link or button is clicked, Documint creates a document using the template id and record id provided in the URL.&#x20;

####


# Add your Airtable Personal Access Token

How to connect your Airtable directly to your Documint account

### Personal Access Token (PAT)

To allow Documint to integrate directly with your Airtable data for use with the [Generation Link](/integrations/airtable/generation-link) and [Automation script](/integrations/airtable/automation-script) methods, you need to add your Personal Access Token to your Documint account. Follow the short video below to get set up.&#x20;

{% embed url="<https://www.youtube.com/watch?v=2IQr70weNYg>" %}

{% stepper %}
{% step %}

### While you're logged in to your Airtable account, go to <https://airtable.com/create/tokens/new>

{% endstep %}

{% step %}

### Enter a name

Give the token a name

<div align="left"><figure><img src="/files/rzvtOS9MzRUD3bUchuJV" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

### Add Scopes

Add the following scopes:

* `data.records:read` (to read your Airtable data)
* `data.records:write` (to potentially update records)
* `schema.bases:read` (to access your table structure)

<div align="left"><figure><img src="/files/KrJxClpkIshQsnFsg0oj" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

### Grant Base Access

Make sure to grant access to the specific base you want to use with Documint

<div align="left"><figure><img src="/files/cQoNjKapMhEY6SVejH45" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

### Create the Token

<div align="left"><figure><img src="/files/Sf8D6aGQu6oHRLvgGTPi" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

### Copy the Token

<div align="left" data-full-width="false"><figure><img src="/files/nzHL8DuJAooL54oDs38N" alt=""><figcaption></figcaption></figure></div>
{% endstep %}
{% endstepper %}

**That’s it!** Now, you can create all your documents directly from your Airtable base.


# Connecting your Documint account with Airtable

How to connect your Airtable directly to your Documint account

There are a few ways you can connect your Documint account to Airtable. You can do it directly from the template or from the Integrations page. On the Integrations page, the quickest way to connect your Airtable account is to use the OAuth option. But if needed, you can also integrate the PAT key manually. In this article, we will go through the three options:

1. Connecting Documint's account from Template
2. Connecting Documint's account using OAuth
3. Connecting Documint's account with PAT (Personal Access Token)

## Connecting Documint's account from Template

{% stepper %}
{% step %}

### Connecting your Airtable source

On your template, you will see a source pane on the right-hand side of the builder. There, you'll see Airtable as an option to connect. Click on the connect button.

<figure><img src="/files/oEQ0LdOEnZvWSXBcuhSO" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Sign in with Airtable

After clicking to connect with Airtable, select the "Sign in with Airtable" option in the pop-up. You'll be redirected to your Airtable account. If you're not logged in yet, just log in, and you'll go to the OAuth page. Feel free to grant access to all resources or to specific bases.&#x20;

<figure><img src="/files/40qx8Fg4Fs0KyjM1wF0c" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
You can have multiple Airtable connections if needed. Each connection can hold one or multiple bases. Feel free to explore what works best for you.&#x20;
{% endhint %}
{% endstep %}

{% step %}

### All set! :tada:

Well done! :clap: Now, go ahead and connect the template with your base and table from Airtable. [Click here](/templates/working-with-dynamic-data/connections/airtable-connection) to check the instructions.
{% endstep %}
{% endstepper %}

## Connecting Documint account using OAuth

{% stepper %}
{% step %}

### Access the Integrations page in Documint

Go to your account settings and access the Integrations page. You will see the Airtable option.

<figure><img src="/files/JXsA9XTtEc3vXdWwdHV2" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Add account

In the OAuth section, click on Add account. You'll be redirected to your Airtable account. If you're not logged in yet, just log in, and you'll go to the OAuth page. Feel free to grant access to all resources or to specific bases.&#x20;

<figure><img src="/files/5wMWLZzIKlveqUJIs8lA" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### All set! :tada:

Well done! :clap: Now, go ahead and connect the template with your base and table from Airtable. [Click here](/templates/working-with-dynamic-data/connections/airtable-connection) to check the instructions.

{% endstep %}
{% endstepper %}

## Connecting Documint account with PAT (Personal Access Token)

### Personal Access Token (PAT)

To allow Documint to integrate directly with your Airtable data for use with the [Generation Link](/integrations/airtable/generation-link) and [Automation script](/integrations/airtable/automation-script) methods, you need to add your Personal Access Token to your Documint account. Follow the short video below to get set up.&#x20;

{% embed url="<https://youtu.be/k20fZO61vWk>" %}

{% stepper %}
{% step %}

### While you're logged in to your Airtable account, go to <https://airtable.com/create/tokens/new>

{% endstep %}

{% step %}

### Enter a name

Give the token a name

<div align="left"><figure><img src="/files/rzvtOS9MzRUD3bUchuJV" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

### Add Scopes

Add the following scopes:

* `data.records:read` (to read your Airtable data)
* `data.records:write` (to potentially update records)
* `schema.bases:read` (to access your table structure)

<div align="left"><figure><img src="/files/KrJxClpkIshQsnFsg0oj" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

### Grant Base Access

Make sure to grant access to the specific base you want to use with Documint

<div align="left"><figure><img src="/files/cQoNjKapMhEY6SVejH45" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

### Create the Token

<div align="left"><figure><img src="/files/Sf8D6aGQu6oHRLvgGTPi" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

### Copy the Token

<div align="left" data-full-width="false"><figure><img src="/files/ULkd6qFdDZvpe0RPOI1q" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

###

{% endstep %}
{% endstepper %}

**That’s it!** Now, you can create all your documents directly from your Airtable base.


# Airtable Extension

## Overview

The Airtable Extension integration is an Airtable Block that is installed from the Airtable Marketplace. Once installed and set up it allows you to simply select a record then generate either a preview of the document or a live version of the document (without a branded footer).

{% embed url="<https://youtu.be/88YShTRwQ94>" %}

## Airtable Setup

#### Step 1: Install the Extension

Open the Tools dropdown and go to 'Extensions'. In the Extensions pane, click 'Add an extension'. With that done, search for Documint and add it.&#x20;

<figure><img src="/files/KYUTLlJdRzmXg7Y2hu2L" alt=""><figcaption></figcaption></figure>

#### Step 2: Create API Key

In a new tab, log in to your Documint account and create an API Key.

<figure><img src="/files/1pV9xUCjxV1tsG5O5TJA" alt=""><figcaption></figcaption></figure>

#### Step 3: Add API Key to app settings

![](/files/XG4fKQDSfsmx2Pmj9tyH)

#### Step 4: Select Template

Once you've successfully connected to Documint you should see a list of your templates. Select the template that you would like to use for the active table. If you don't already have a template that you want to use with the active table then create a new template in Documint, return to Airtable and select the newly created template.

![](/files/eOhjW9t7erv3mz9bD8kB)

### Documint Setup

Once you've set up the app within Airtable you can start adding variables to your template.


# Generation Link

The generation link integration available to every user type.

### Generation Link

The Generation Link integration uses a special URL to generate your document. This URL is created dynamically by a formula in either a Formula field or a Button field. When the link or button is clicked, Documint creates a document using the template ID and record ID provided in the URL.&#x20;

![](/files/ItZShLXd7ZO0AgPTxyqv)

{% embed url="<https://youtu.be/V7T54QvShZQ>" %}

{% content-ref url="/pages/cmA1vQNIzcbRkp2Ai6ls" %}
[Connecting your Documint account with Airtable](/integrations/airtable/connecting-your-documint-account-with-airtable)
{% endcontent-ref %}

### Create the formula for your Generation Link

With the [Airtable Connection](/templates/working-with-dynamic-data/connections/airtable-connection) successfully established, you can now choose the specific base and table that you wish to work with. Once you've done that, just click on `Add formula` in the Airtable connection under Sources.

<figure><img src="/files/Jzbvb1mPbwcpDx0rQ8HK" alt=""><figcaption></figcaption></figure>

Go for the `Generation Link` option.

<figure><img src="/files/OkkPnPD11Kke4ptGK6Vg" alt=""><figcaption></figcaption></figure>

Then select the attachment field that will store the generated document.&#x20;

<figure><img src="/files/KeQTc5Aqw1J8uU00fnRH" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
This is the field in Airtable where the auto-generated document will be located.&#x20;
{% endhint %}

If you don’t already have a field for this, create it in Airtable by adding a new field with the field type ‘attachments.’

<figure><img src="/files/obrC5oagcHGH3qEnbLA9" alt=""><figcaption></figcaption></figure>

And then, click on `Generate link`.&#x20;

<figure><img src="/files/z9ZFoDRvyFzWwryTtkT4" alt=""><figcaption></figcaption></figure>

Then the link will be ready for you to copy. Now, follow the steps to add the Button field on your Airtable base.&#x20;

<figure><img src="/files/izrkfcxWUQSqQAiTGdry" alt="" width="563"><figcaption></figcaption></figure>

<details>

<summary>Additional Options</summary>

#### **Overwrite Attachments**

When set, this will overwrite all existing attachments in the specified attachment field with the latest document.

#### **Expand Linked Records**

Linked Record fields in Airtable are sent from Airtable as record ids instead of the actual data of the linked records. If you want to use the data from linked records then you'll need to tell Documint to expand those records. By default, Documint will only expand linked records (with [Table\_Id fields](#joining-linked-records)) on the record that the document is generated from. If you want to expand linked records of linked records (and so on) then you'll have to set this value to the number of relationships that you want to expand.

Documint will only expand records of Linked Record fields that have an associated Table\_Id field. [Learn more.](#joining-linked-records)

#### **Mode**

Mode allows you to control how documents are created.&#x20;

There are 3 options:

1. **Default (Recommended)** - uses the Active status of the template
2. **Preview** - renders documents as inactive (meaning they won't count towards your quota) and they won't be saved back to Airtable. This is great when testing documents and acts as an alternative to using the Previewer in the Template Designer. [Learn more.](#preview-mode)
3. **Active** - renders documents as Active (meaning they will count towards your quota) whether your template status is Active or Inactive.

#### Watch / ignore data changes

Set which fields to either watch for changes or ignore changes to when [preventing duplicate document creation](#duplicate-document-prevention)

</details>

## Create Button Field

Then, in Airtable, create another button field with an ‘Open URL’ action to open this formula. Paste the formula copied in the previous step into the `URL formula` field and click "Create field".

<figure><img src="/files/8rbreRcQkQc7ZPrbvnry" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/tOPTykqAS68dLtwORE8j" alt="" width="375"><figcaption></figcaption></figure>

**That’s it!**  Now, whenever a user clicks the button, a document will be generated for that record. If a document already exists with the data from that record and the template has not been changed, then the existing document will be displayed. This prevents generating the same document multiple times.


# Automation Script

This feature allows you to create documents within Airtable, automatically, using Airtable automations.

Create documents automatically using Airtable Automations.

{% embed url="<https://youtu.be/xhg7RK9LuPg>" %}

## Setup

{% stepper %}
{% step %}

### Connecting Documint and Airtable

First, connect your Documint account to Airtable. Follow this article to get that set up.

{% content-ref url="/pages/cmA1vQNIzcbRkp2Ai6ls" %}
[Connecting your Documint account with Airtable](/integrations/airtable/connecting-your-documint-account-with-airtable)
{% endcontent-ref %}
{% endstep %}

{% step %}

### **Connect the template with your database**

In the template builder, select the Airtable connection you made, pick the base, and the table you'd like to integrate with Documint. Then, continue to select the fields you'd like to use on your template.&#x20;

<figure><img src="/files/sDdaWAhFm9haeXKILY6g" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Create the Script

Under Sources, in the Airtable connection, click on "Add formula" and select the "Automation script" option.&#x20;

<figure><img src="/files/cP1DXgCHsqh6LNdMCQro" alt=""><figcaption></figcaption></figure>

In the table you have integrated the template with, add an attachment field to store the created document.

<figure><img src="/files/OVXXEehEMCbtXItJyJcA" alt=""><figcaption></figcaption></figure>

Go to the Automation Script tab, select the attachment field from the dropdown, and the Script will show up for you to copy.

<figure><img src="/files/XnP1PYmtbHaukSLGH4tO" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Create the Automation

Switch back to Airtable and open the Automations panel

<figure><img src="/files/5GL6vtR2Qeb0UyuGg2JI" alt=""><figcaption></figcaption></figure>

Create a new automation and add your trigger. This can be any trigger that you'd like.

<figure><img src="/files/7y0b4pGtqM7HjWYnfzat" alt=""><figcaption></figcaption></figure>

Configure your trigger.

<figure><img src="/files/uv4tICJuXvAeRl4G9Be1" alt=""><figcaption></figcaption></figure>

Add an action and select 'Run script'

<figure><img src="/files/wh8MqSqkfbrh8kEToseL" alt=""><figcaption></figcaption></figure>

Paste your script

![](/files/ZEe3MYRCigxnRg3sbWFN)

Add an input variable named `record_id` and set the value to the `Record ID`

![](/files/mh8N3ql1jqDga1LCo7nK)

Test your script and click `Finish editing`

![](/files/YTYBXsx5OD4mDsnrn4f9)
{% endstep %}
{% endstepper %}

## How to delete an Automation Script

If you have created an Automation Script and need to delete it, follow these steps to remove it:

1. Access the Sources panel

<figure><img src="/files/A0P5UAbuvvAiGYwslShb" alt="" width="563"><figcaption></figcaption></figure>

2. Select the Automation Script you wish to delete, and

<figure><img src="/files/2m9hoOZvltHtFYALGPq3" alt="" width="563"><figcaption></figcaption></figure>

3. Click the `delete` option at the bottom left of the popup

<figure><img src="/files/MsQHQFYFahT5caJLciVV" alt="" width="563"><figcaption></figcaption></figure>


# Adding Images from Airtable

You can display images from attachment fields dynamically in your documents.

#### Example 1: Displaying a single attachment

{% tabs %}
{% tab title="Template" %}
Add image element

![](/files/Kn5cCJkZo5gYdgxBcH2M)

Select the `Dynamic Image` option (double-click)

![](/files/tW613dR7T83mcy7ivYbh)

The properties pane will open. Select the field name holding the image followed by `.url`

![](/files/eACMErNDdPrGzy7Gz4Tp)

{% hint style="info" %}
If you have a repeating list and want to display the first image, just click the `(x)` and add the field name manually with the following syntax `[Image].0.url`
{% endhint %}
{% endtab %}

{% tab title="Airtable" %}
![](/files/L0fy07F6bFZjE7cptBzn)
{% endtab %}

{% tab title="Result" %}
![](/files/iAaaakd5kSIjcP5wd66v)
{% endtab %}
{% endtabs %}

#### Example 2: Displaying multiple images

{% tabs %}
{% tab title="Template" %}
Repeat the element for each attachment by selecting the element and opening the **Logic Editor**

![](/files/hHzPpytEnjRYZRoCeOxA)

Switch to the **Repeat/Loop** tab, select the name of the attachment field in the **Field List** dropdown then **Save**

![](/files/XwMvE56qDUey9WPjERVE)

Add an Image Element to the repeating element

![](/files/B7RWvhQnPrOSSrJru95G)

Select the `Dynamic Image` option (double-click)

![](/files/tW613dR7T83mcy7ivYbh)

The properties pane will open. Select the `url` option

![](/files/hoOtkuPhnCgFEH3QV3Yp)

{% hint style="info" %}
To reduce the size of the final document, we suggest you use the `thumbnails.large.url` option
{% endhint %}
{% endtab %}

{% tab title="Airtable" %}
![](/files/L0fy07F6bFZjE7cptBzn)
{% endtab %}

{% tab title="Result" %}
![](/files/Y9z9XmPuCLufvaIsnRzZ)
{% endtab %}
{% endtabs %}


# Lookup Fields

Displaying lookup fields in Documint

{% embed url="<https://support.airtable.com/hc/en-us/articles/360042312194-Lookup-field-overview>" %}

A lookup field allows you to pull record contents from one linked record into another linked record. As a reminder, linked relationships can be either within the same table or across two separate tables.

### Displaying on a single line

{% tabs %}
{% tab title="Template" %}

```
Company Names
```

{% endtab %}

{% tab title="Data" %}

```
{
    "company_names": [ "Documint", "SunRun" ]
}
```

{% endtab %}

{% tab title="Untitled" %}
Documint, Sunrun
{% endtab %}
{% endtabs %}

### Displaying on multiple lines

1. Drag the lookup field token to the template

<figure><img src="/files/KRQSSFW46Et6Fc7F4oAb" alt=""><figcaption></figcaption></figure>

2\. Click **Edit Logic** on the left panel and edit **Repeat/Loop**

![](/files/z3xOa2BlOOHm05RErZkq)

3\. Add the lookup field name in the **List Field** box and **Save**

<figure><img src="/files/7sdOjkTaA5bzk4vUSmlD" alt=""><figcaption></figcaption></figure>

{% tabs %}
{% tab title="Template" %}

```
this
```

{% endtab %}

{% tab title="Data" %}

```
{
    "company_names": [ "Documint", "SunRun", "Whole Foods" ]
}
```

{% endtab %}

{% tab title="Result" %}
Documint

SunRun

Whole Foods
{% endtab %}
{% endtabs %}

{% hint style="warning" %}
If Lookup fields are linked to Linked Records, you will need to expand it in the Airtable connection
{% endhint %}


# Documents from Multiple Records

By default, Documint generates data based on an individual [record](https://support.airtable.com/hc/en-us/articles/360021333094-Getting-started-tables-records-and-fields#record) or row. But what if you need several records to display on your template? Here are the steps to achieve this result.<br>

1. Head over to Airtable and create a table that will group all your record items together. In this example, we will want to display all the description in the Line Items table along with each record's information like price, quantity, etc.

![](/files/wbxJO4WsAj8T6a9Q9W57)

2\. Once you have a table ready to group these line items, create a linked record field. In this example, we decided to group all the line items in the Invoice table.&#x20;

{% hint style="info" %}
Documents will be generated from the Invoice Table.
{% endhint %}

![](/files/oto9pXuear1D96jcvfZU)

3\. Begin adding all the records you need to be displayed in the document.&#x20;

{% hint style="success" %}
See the [Filter List](/templates/document-structure-and-layout/page-elements/repeat-loop#filtering-list-items) functionality to filter items needed to be displayed.
{% endhint %}

![](/files/PteNRhbqDKfcCRjJIM3K)

{% hint style="warning" %}
Remember to [expand](/templates/working-with-dynamic-data/connections/airtable-connection#configuring-linked-records) the Linked Record in the Airtable Connection.
{% endhint %}

4\. Add the [Generation Link](/integrations/airtable/generation-link) or [Automation script](/integrations/airtable/automation-script) to the new table created.&#x20;

![](/files/zb3BGaR4QELrTJ6CcSeQ)

#### Documint Template Designer Page

5\. Create a Row with the number of elements you will need to create the line items. Select the Row and Edit Logic.&#x20;

{% hint style="info" %}
Adding a row to a row and then adding more columns will align fields better.
{% endhint %}

![](/files/w8CxXhiD1dDQRk4GevSf)

6\. In the Logic editor, select Repeat/Loop and select the name of the linked field created in the earlier steps. In our example, we will loop over the fields from the "Line Items" table.

<figure><img src="/files/rbcyxdr1Z6iS8Xb7fBhu" alt="" width="563"><figcaption></figcaption></figure>

7\. Edit the template style as desired.&#x20;

8\. In Airtable, generate a document to see all your records! No more typing items from your database one by one!

![](/files/lLOGwhYjEEnjIX7fqjm2)


# Duplicate Document Prevention

By default, Documint will first check if a document has already been created using the same template and data before creating a new one. If a document has already been created, Documint will return the existing document. If not, it will create a new document. This prevents the same document from being generated more than once and counting against your quota multiple times.&#x20;

There may be cases where you want/need more fine-tuned control over this functionality. In those cases, you can tell Documint specifically which fields in your data to watch for changes. This is accomplished using the `watch_fields` or `ignore_fields` query parameters in the Generation Link URL.&#x20;

### Setup

To use this feature, you will need to add either `watch_fields` or `ignore_fields` as a query parameter to your Generation Link. If both parameters are passed, only the `watch_fields` parameter will be evaluated. Add a comma-separated list of field names, in [snake-case](broken://pages/-M_uzGBz2ZMM9JoJT1W4#snake-case), as the value for the parameter.

{% hint style="warning" %}
Field names must be converted to [**snake-case**](broken://pages/-M_uzGBz2ZMM9JoJT1W4#snake-case) when used in this query parameter.
{% endhint %}

{% hint style="info" %}
Every time a document is created, Documint creates a hash of the data that is being merged and the template. This allows Documint to detect changes in either without ever storing your data. &#x20;
{% endhint %}

![](/files/CsPSZeqiHfRsRrYD9Pgk)


# Password Protection

To add password protection, simply add a text field to your table with the name `Documint Password` (note the spelling of “Documint”). The value entered in that field will be the password to protect documents for that record.

![](/files/1DSIUVOuhVeoQq3Jhzi1)

Copy the Shared link from the document preview window

<figure><img src="/files/Ry5DjwrOXprgSgM5RFwV" alt=""><figcaption></figcaption></figure>

When the user clicks this link they will see this screen the first time they try to access the document or if the password is changed in Airtable.

![](https://s3.amazonaws.com/documint/support/images/airtable-document-password-2.png)

{% hint style="danger" %}
**PLEASE NOTE**

Password protection only applies when the Shared Link is used, not to the PDF itself. If the PDF is downloaded and saved in another location, the password screen will not be shown, and the PDF can be readily opened.
{% endhint %}


# Legacy Airtable Integration


# Field Types  to Documint Variables

## Fields Types

{% hint style="danger" %}
Field names in Airtable are converted to snake-case in Documint. This means your variables need to be the snake-case version of the field name.  For example,  if a field in Airtable is named `Order Total`, its variable name in Documint needs to be`order_total` . Notice the space is replaced with an underscore and everything is converted to lowercase.
{% endhint %}

Airtable fields names must be converted to snake-case when being used in your template. The basic rules of snake-case are:

1. spaces are converted to underscores
2. double underscores are converted to single underscores
3. underscores at the beginning or end of the string are removed
4. some special characters are replaced with underscores
5. all upper-case characters are converted to lower-case

The easiest way to convert your field names to snake-case is by pasting the field name into the New Variable tool in the template designer.

### Mapping Data from Airtable App

Once you have setup the Airtable App and chosen the template you will be using, the table's fields will be available to copy and paste into your template.

![](/files/6znuelXvxiclU9uhJJvv)

1. Click on the field names to copy the field's token to your clipboard.
2. Paste it into your Documint template.
3. Generate a document (make sure the correct template is selected).

##


# Adding Images from Airtable

You can display images from attachment fields dynamically in your documents.

#### Example 1: Displaying a single attachment

{% tabs %}
{% tab title="Template" %}
Add image element

![](/files/5hRXiHiZfuxJ6RG9IYV5)

Add path to image URL

![](/files/Hzz8cz2t4QU9xJAktby3)

![](/files/1KkpWCuan2XMT9CNfiuA)

![](/files/ZnNGstQnY7npSAfmLMCj)
{% endtab %}

{% tab title="Airtable" %}
![](/files/fM3y0jgZmQPpfoSN8Yg5)
{% endtab %}

{% tab title="Result" %}
![](/files/FmG9pNzHVeo0UOYXojZn)
{% endtab %}
{% endtabs %}

#### Example 2: Displaying multiple images

{% tabs %}
{% tab title="Template" %}
Repeat the element for each attachment by selecting the element and opening the **Logic Editor**

![](/files/kQnyPlDQsJyQ5WvlNRrf)

Switch to the **Repeat/Loop** tab, enter the name of the attachment field in the **List variable** input then **Save**

![](/files/8sYPPncfpSbenHZ53LiW)

Add an Image Element to the repeating element

![](/files/nowgpviO7PIHxkbgpOas)

Add the variable as the path to image URL

![](/files/7bXV8wNPlIrsD4pkMYsV)

![](/files/xXfEUUNKN1XUZQiK5y9E)

Final Template

![](/files/Pg5wElEUfiCJ1NsIfoFM)
{% endtab %}

{% tab title="Airtable" %}
![](/files/0vOaPHlrpB86pdz3e1uL)
{% endtab %}

{% tab title="Result" %}
![](/files/5MOOrZJ18NEoSC1pDnAs)
{% endtab %}
{% endtabs %}

##


# Expanding Linked Records

Learn how to add a Table Id for your linked records

By default, Airtable doesn’t transmit linked data that might be present in relationships between two or more tables when using linked records. If you want to use data from a linked record, which connects data from a separate, linked table, you will need to indicate the ID of the additional table(s) being linked.

### What are Linked Records?

In Airtable, linked records enable fields to be shared between two or more tables. One table will have records that link to another, connecting the fields and data of the second table with the first one.

<figure><img src="/files/l50WrVFUJd1z7a8b6sbx" alt=""><figcaption><p>(Image from <a href="https://www.airtable.com/guides/build/connect-data-with-linked-records">Airtable's linked record guide</a>)</p></figcaption></figure>

### Using Linked Records

Linked Record fields in Airtable are sent from Airtable as record Ids instead of the actual data of the linked records. If you want to use the data from linked records then you'll need to indicate to Documint how to expand those records.

<figure><img src="/files/uLqIgUsDwR5Sd8fj8JCM" alt=""><figcaption></figcaption></figure>

In the example above, this Account column consists of linked records (‘Acme Corporation’, ‘Globex Corporation’, etc.) referring to a separate Airtable table called ‘Accounts’. To get additional data from the Accounts table, such as name and address, the Account Table ID must be provided for Documint to know where the expanded data is located.

#### Table Id Field

{% embed url="<https://youtu.be/1nhbH7OdfMU>" %}

You will need to find the table ID for the table that the linked records belong to (in the case above it would be the “Accounts” table). The table Id is contained within the URL of the table you are currently editing on Airtable.

<figure><img src="/files/miwTrGywo9JUlkQr3bH5" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/YDMepTTYSR5ncSa5GViU" alt=""><figcaption><p>(Diagram courtesy of Airtable)</p></figcaption></figure>

{% hint style="warning" %}
**\*The table ID will start with `tbl` and end before the next `/`**
{% endhint %}

In this example, you would navigate to the Accounts table by clicking the tab on Airtable. You should notice the URL in your browser change. Specifically, the table ID portion changes since a different table is now being edited. Copy this table’s table ID, which for this example is: **tblP6MhlwEXMPLSk**

<figure><img src="/files/0ofPX7U5J92hXTKgD9VR" alt=""><figcaption></figcaption></figure>

Now, navigate back to the main table (in this example, Orders).

Create a new formula field that will contain the linked table ID. For this example, Accounts would be associated with a new ID field in the same table, called Account Table\_Id. The naming format must follow this convention: ‘\[Linked field Name] Table\_Id’.

Paste the copied table ID into the formula field of the new ID field, inside quotes "tblxxxxxxxxxx" (e.g. Account Table\_Id) and finish creating the field.

<figure><img src="/files/ZndkHqhbiA8UUaU12S0v" alt=""><figcaption></figcaption></figure>

Now, from the main template being for the template (e.g. Orders), Documint is able to retrieve the linked record data (e.g. Account Name, Account Address, etc.) from the connected table (e.g. Account), which it references through that table’s ID.

### Managing Multiple Levels of Linked Records&#x20;

\
By default, Documint will only expand linked records (with Table\_Id fields) down to one level from the main table (ie. Orders have the Account field, which links to the Accounts table). If you want to expand linked records of linked records (and so on) then you'll have to set a larger value to the number of relationships that you want to expand. This is done when setting up the [Airtable Generation Link](https://docs.documint.me/integrations/airtable/generation-link).

<figure><img src="/files/SjMakg64Bg83wSLik3dE" alt=""><figcaption></figcaption></figure>

For example, to expand linked records another level down from the first linked records, you would type in 2 in the Expand linked records field above. This would also entail creating another ID formula field in the linked table and copy/pasting the table ID from the URL of the table linked to the first-linked table. Feel free to watch the [video tutorial](https://docs.documint.me/additional-resources/how-to-videos/airtable-data-and-variables-videos) for a walkthrough.




---

[Next Page](/llms-full.txt/1)

