# Email Actions

## Email  <a href="#email-action" id="email-action"></a>

The email action allows sending an email when an event occurs on a form. With a multitude of options, users can configure this action to satisfy different workflows and use cases. Connect to your own Email transport, configure the email template, or dynamically attach files to the email.&#x20;

<figure><img src="https://501951130-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6LdEf8SjBIeQDsRL3BdV%2Fuploads%2FTq0ChkoEguIzmfi7EwaD%2Femail.jpg?alt=media&#x26;token=692c457a-98ae-4752-832a-1719ca513766" alt=""><figcaption></figcaption></figure>

## Settings

**Transport:** Select which email transport to use. These need to be configured in your project settings. Transports will not be available for selection if you haven’t configured them.

{% hint style="info" %}
When using the Form.io SaaS offering @ portal.form.io, ***you must set up your own Transport*****.** The default transport service provided by Form.io is no longer available. Please see the documentation on [**Email Integrations**](https://help.form.io/form-building/actions/broken-reference) for instructions on how to proceed.&#x20;
{% endhint %}

**From:** Enter the email address the email will be sent from.

**Reply-To: Email Address:** Set a different address the recipient will reply to.&#x20;

**To:** Enter the email addresses to send to.&#x20;

You can use field data from the form by using `{{ data.email }}` where the field's property name is email.

**Send a separate email to each recipient:** Each recipient designated in the TO field will receive an individual email

**Cc: Email Address:** Send a copy of the email to the listed email addresses

**Bcc: Email Address:** Send a blind copy of the email to the listed email addresses. Recipients will not see the other email addresses listed.&#x20;

**Subject:** The subject of the email. By default, the Subject will interpolate the form title.&#x20;

You may use other field data from the form using `{{ data.fieldname }}`

**Email Template URL:** The HTML template used to style and format your email content. By default, the email action will utilize the following HTML template to organize the content of the email:

<https://pro.formview.io/assets/email.html>

**Message:** The message in the email.&#x20;

You may use field data from the form using `{{ data.fieldname }}`

**Rendering Method:** Determines how the email will render

*Dynamic* rendering utilizes formio.js to render the email.&#x20;

*Static* rendering using the Nunjucks templating engine.

**Attach Submission Files:** Check this if you would like to attach uploaded files from the file component to the email.

**Attach PDF Files:** Check this if you would like to attach a PDF of the submission to the email. This will count toward your PDF Submission count for every email sent.

{% hint style="info" %}
If you are remotely deployed, please set the BASE\_URL=<https://yourdomain.com> to match the API server’s domain protocol and domain name for the formio-enterprise server
{% endhint %}

## Nunjucks Templating

All of the form fields are sent through a templating engine called [**Nunjucks**](https://mozilla.github.io/nunjucks/). It is recommended that you read through the documentation of this templating language to understand how it can be utilized to produce very complex templates for your emails using form data.&#x20;

[**Click Here**](https://mozilla.github.io/nunjucks/templating.html) for the full  Nunjuck Templating documentation.

Use the following *variables* which are provided to each template.

<table><thead><tr><th width="235">variable</th><th>Function</th></tr></thead><tbody><tr><td>data</td><td>The submission data which maps to the data object of the submission. Example: <code>{{ data.firstName }}</code> would map to the data provided in the "First Name" field if one is provided in your form.</td></tr><tr><td>id</td><td>The ID of the submission being submitted.</td></tr><tr><td><code>{{ data.[RESOURCE]Obj }}</code></td><td>Because all of the nested resources will only show their "template" data, every nested resource also has an object property assigned to the data to give you access to the full resource object assigned to that submission. For example, if you have a <strong>Customer</strong> resource field assigned to an <strong>Order</strong> resource, and you sent an email from the order. <code>{{ data.customer }}</code> would only show the templated customer, however <code>{{ data.customerObj }}</code> would contain the full customer object. In this case, you could type <code>{{ data.customerObj.data.email }}</code> to get the customers email address within the template.</td></tr><tr><td>content</td><td>This is the content within the Mail message section that you wish to inject within a template. This is useful if you wish to have a common template that all your emails use, and then use the "message" portion to construct the content within that template using <code>{{ content }}</code></td></tr><tr><td>form</td><td>The form object that this email is being sent from. <code>{{ form.components }}</code> would provide you with all the components within the form.</td></tr><tr><td>components</td><td>A flattened list of form components. Example, <code>{{ components.firstName.label }}</code> would print out the First Name component.</td></tr><tr><td>owner</td><td>The user who owns the form.</td></tr><tr><td>req</td><td>This is a stripped-down request object that contains the following parameters. <br><br></td></tr><tr><td>res</td><td><p>A stripped down response object that contains the following parameters.</p><p></p></td></tr><tr><td>mail</td><td>The current mail object being sent. Example <code>{{ mail.to }}</code> would contain the email address who the message is being sent to, which contains the following parameters.</td></tr></tbody></table>

### **Nunjucks Filters**

In addition to the core filters provided by Nunjucks, the following additional filters are also included for use within Emails.

<table data-header-hidden><thead><tr><th width="241">date</th><th>Prints out a date value as a readible date. See Nunjucks Date Filter for detailed documentation. Example {{ created | date("YYYY") }}</th></tr></thead><tbody><tr><td><code>date</code></td><td>Prints out a date value as a readible date. See <a href="https://github.com/e-picas/nunjucks-date-filter"><strong>Nunjucks Date Filter</strong></a> for detailed documentation. Example <code>{{ created | date("YYYY") }}</code></td></tr></tbody></table>

### **Nunjucks Macros**

In addition to template variables, we also provide a number of macros that can be used to easily render form submission information into your emails. These are as follows.

<table data-header-hidden><thead><tr><th width="313">{{ table(form.components, title) }}</th><th>Prints out a nested table of the form submission.</th></tr></thead><tbody><tr><td><code>{{ table(form.components, title) }}</code></td><td>Prints out a nested table of the form submission.</td></tr><tr><td><code>{{ submission(data, components) }}</code></td><td>Prints out a flat submission data table.</td></tr><tr><td><code>{{ value(key) }}</code></td><td>Prints out a readable value for a submission of a certain field. Example <code>{{ value('birthday') }}</code></td></tr><tr><td><code>{{ label(key) }}</code></td><td>Prints out the configured label for a certain field. Example <code>{{ label('birthday') }}</code></td></tr></tbody></table>

### Template Service

Considering that the template rendering is processor intensive, it is also possible to deploy the template rendering system as a separate service.

The library that governs the template rendering system is called Form.io Workers. This library can be found by going to [**https://github.com/formio/formio-workers**](https://github.com/formio/formio-workers). The deployed Form.io platform is also capable of offloading all email template processing to this separate micro-service. Within this library, you have the ability to either run this as a stand-alone Node.js service, or you can also use a tool such as [**Claudia.js**](https://www.claudiajs.com/). &#x20;

For example, if you wish to push this into your own AWS Lambda function using Claudia, you can run the following within the directory.

```
npm run deploy
```

If you wish to see the command that is executed within the NPM script, you can open up the package.json file and see the "deploy" script within the scripts section. This uses Claudia to push this into AWS Lambda as a live endpoint.

#### **Endpoint**

Once the template service has been deployed, the "nunjucks" service can then be accessed using the following url.

`https://[TEMPLATE_SERVICE_URL]/worker/nunjucks?key=yourkey`

#### **Template Service Configuration**

The template service can be configured with the following environment variables. These variables can be provided within the `.env` file included with the source code of this library.

<table><thead><tr><th width="230.66666666666666">Environment Variable</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td>PORT</td><td>The port to bind to when running the service</td><td>3000</td></tr><tr><td>KEY</td><td>This is the secret key that is used to communicate to the template service via API. This key is used within the query parameter.</td><td>https://worker.yourdomain.com/worker/nunjucks?key=yourkey</td></tr><tr><td>LAMBDA</td><td>Tells the service if it is running within AWS Lambda or locally within a VM.</td><td>1 - To enable use lambda<br>2 - To use local install</td></tr></tbody></table>

Once you have the template service up and running, you can then tell the Form.io Enterprise Server to use this service with the TEMPLATE\_SERVICE environment variable like so.

```
TEMPLATE_SERVICE=https://worker.yourdomain.com/worker/nunjucks?key=yourkey
```

### Template Examples

The Email action Message carries a default **Nunjuck Macro** to produce an output of all field data within the submission which is found in the Message setting field of the action.&#x20;

&#x20;`{{ submission(data, form.components) }}`

This Macro works in conjunction with the HTML template found within the **HTML Email Template** field:

`https://pro.formview.io/assets/email.html`

The following examples will demonstrate how to add Nunjuck [**Tags**](#user-content-fn-1)[^1] and [**Macros**](#user-content-fn-2)[^2] to your own custom template messages. These examples will use [**HTML**](https://www.w3schools.com/html/html_tables.asp) to format the content of the email inside a readable table.&#x20;

Each example utilizes the following form which can be [**Imported**](https://help.form.io/userguide/forms/form-creation#copy-a-form) into your own project using the Form Embed URL.

[**`https://khvenypsypifjpi.form.io/expensereporting`**](https://khvenypsypifjpi.form.io/expensereporting)

<figure><img src="https://501951130-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6LdEf8SjBIeQDsRL3BdV%2Fuploads%2FA4JmScnIJiBxGn4lu5S1%2Fexpenseform.jpg?alt=media&#x26;token=7d03fea2-963f-477d-8826-318efbb32118" alt=""><figcaption><p>Expense Form Example</p></figcaption></figure>

#### **Extracting Field Submission Data**

In this example, the email template will use Nunjuck Macros to interpolate the **Employee Name**, **Employee ID**, and **Department** field data from the submission and output the information into an HTML table inside the email message.

<figure><img src="https://501951130-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6LdEf8SjBIeQDsRL3BdV%2Fuploads%2FjRPzq6uPZQcAxV9LXyoA%2Femailfield.jpg?alt=media&#x26;token=63918f3e-7fe7-4400-acd6-92c6dc9dfc32" alt="" width="563"><figcaption></figcaption></figure>

Add the following code to the Message field within the Email Action settings.

<pre class="language-javascript" data-full-width="true"><code class="lang-javascript"><a data-footnote-ref href="#user-content-fn-3">&#x3C;h3>&#x3C;b>User Information&#x3C;/b>&#x3C;/h3></a>
<a data-footnote-ref href="#user-content-fn-4">&#x3C;table align="center" style="width:75%;"></a>
  &#x3C;tr>
    &#x3C;td>&#x3C;b><a data-footnote-ref href="#user-content-fn-5">{{ label("employeeName") }}</a>&#x3C;/b>&#x3C;/td>
    &#x3C;td><a data-footnote-ref href="#user-content-fn-6">{{ value("employeeName") }}</a>&#x3C;/td>
  &#x3C;/tr>
<strong>  &#x3C;tr>
</strong>    &#x3C;td>&#x3C;b><a data-footnote-ref href="#user-content-fn-7">{{ label("employeeId") }}</a>&#x3C;/b>&#x3C;/td>
    &#x3C;td><a data-footnote-ref href="#user-content-fn-8">{{ value("employeeId") }}</a>&#x3C;/td>
  &#x3C;/tr>
  &#x3C;tr>
    &#x3C;td>&#x3C;b><a data-footnote-ref href="#user-content-fn-9">{{ label("department") }}</a>&#x3C;/b>&#x3C;/td>
    &#x3C;td><a data-footnote-ref href="#user-content-fn-10">{{ value("department") }}</a>&#x3C;/td>
  &#x3C;/tr>
&#x3C;/table>
</code></pre>

#### **Using For Loop To Output Field Submission Data Inside Arrays**

The **`for`** tag is a Nunjuck tag that iterates over arrays and dictionaries. This example demonstrates how to interpolate data from fields inside an array (Data Grid, Edit Grid, etc) and output that data into the email message. Array data is referenced differently than other types of data, because of this, we are unable to use the Nunjuck Macro provided in the previous example and must set up a For Loop inside the message template.&#x20;

To reference array data:

1. Create a [**For Loop**](https://mozilla.github.io/nunjucks/templating.html#for) provided by the Nunjuck templating documentation.\
   [`{% for X in X %}`](#user-content-fn-11)[^11]
2. Set the array data inside the loop. Data inside of Data Grids or Edit Grids is referenced using the row attribute. \
   [`{% for`` `**`row`**` ``in X %}`](#user-content-fn-12)[^12]
3. Reference the Array property name within the loop. In this example our Data Grid property name is expense.\
   [`{% for row in`` `**`data.expense`**` ``%}`](#user-content-fn-13)[^13]
4. Now we can reference the individual fields within the array. Use the `row` variable and the API Property Name of the field\
   [`{{ row.date }}{{ row.expenseType }}{{ row.amount }}`](#user-content-fn-14)[^14]
5. Close out the For Loop\
   `{%`` `**`endfor`**` ``%}`
6. Here is an example of a For Loop being used within an HTML table and Nunjuck Macro. The Table will create columns for the Expense Data, Expense Type, and Amount. The Nunjuck Macro will interpolate the Label of these fields from the Form and present them as the column headers. The For Loop lists all the component row data inside the Expense Data Grid and presents the row data within the HTML table.&#x20;

<figure><img src="https://501951130-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6LdEf8SjBIeQDsRL3BdV%2Fuploads%2FkZn0PJTsXCKuExOEwgMq%2Femailarray.jpg?alt=media&#x26;token=33ca75b2-db5d-493d-a31a-f7782ae297eb" alt="" width="563"><figcaption></figcaption></figure>

Add the following code to the Message field within the Email Action settings.

<pre class="language-javascript"><code class="lang-javascript">&#x3C;center><a data-footnote-ref href="#user-content-fn-15">&#x3C;h3>&#x3C;b>Expense Report&#x3C;/b>&#x3C;/h3></a>&#x3C;/center>
<a data-footnote-ref href="#user-content-fn-4">&#x3C;table align="center" style="width:75%;"></a>
&#x3C;th align="left"><a data-footnote-ref href="#user-content-fn-16">{{ label("date") }}</a>&#x3C;/th>
&#x3C;th align="left"><a data-footnote-ref href="#user-content-fn-17">{{ label("expenseType") }}</a>&#x3C;/th>
&#x3C;th align="left"><a data-footnote-ref href="#user-content-fn-18">{{ label("amount") }}</a>&#x3C;/th>
<strong><a data-footnote-ref href="#user-content-fn-19">{% for row in data.expense %}</a>
</strong> &#x3C;tr>&#x3C;td><a data-footnote-ref href="#user-content-fn-20">{{ row.date }}&#x3C;/td> &#x3C;td>{{ row.expenseType }}&#x3C;/td>&#x3C;td>{{ row.amount }}</a>&#x3C;/td> &#x3C;/tr>
{% endfor %}
&#x3C;/table>
</code></pre>

**If tag for conditional data output inside the email content**

The **If** tag tests a condition and lets you selectively display content inside the email. It behaves exactly as javascript's `if` behaves.

In this example, the Manager field data should be included in the email content when the field contains data.

1. Add an **If** tag inside your message template\
   [`{% if X %}`](#user-content-fn-21)[^21]
2. Add the condition statement inside the tag\
   [`{% if data.manager !== "" %}`](#user-content-fn-22)[^22]
3. Add the output of the condition. If the Manager field has a value, the condition will output the Label and data Value of the field inside the HTML table

   <pre><code>&#x3C;th align="left"><a data-footnote-ref href="#user-content-fn-23">{{ label("manager")}}</a>&#x3C;/th>
   &#x3C;tr>
   &#x3C;td><a data-footnote-ref href="#user-content-fn-24">{{value("manager")}}</a>&#x3C;/td>
   &#x3C;/tr>
   </code></pre>
4. Close out the If tag\
   [`{% endif %}`](#user-content-fn-25)[^25]

<figure><img src="https://501951130-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6LdEf8SjBIeQDsRL3BdV%2Fuploads%2FJdGUoMuaY76EHCmIB0H9%2Femailif.jpg?alt=media&#x26;token=ab3c3742-18d9-4d09-b157-57d7e1171c7e" alt="" width="563"><figcaption></figcaption></figure>

<pre><code>&#x3C;center><a data-footnote-ref href="#user-content-fn-3">&#x3C;h3>&#x3C;b>User Information&#x3C;/b>&#x3C;/h3></a>&#x3C;/center>
<a data-footnote-ref href="#user-content-fn-4">&#x3C;table align="center" style="width:75%;"></a>
<a data-footnote-ref href="#user-content-fn-26">{% if data.manager !== "" %}</a>
&#x3C;th align="left"><a data-footnote-ref href="#user-content-fn-27">{{ label("manager")}}</a>&#x3C;/th>
&#x3C;tr>
&#x3C;td><a data-footnote-ref href="#user-content-fn-28">{{value("manager")}}</a>&#x3C;/td>
&#x3C;/tr>
<a data-footnote-ref href="#user-content-fn-29">{% endif %}</a>
&#x3C;/table>

</code></pre>

**Using If tag inside a For Loop**&#x20;

In some cases, you may want to incorporate **If** tags where the condition is based on fields inside an array. In this case, the If tag must be set inside the For loop of the message template.&#x20;

Within the form, there is a field inside the Expense DataGrid called **Other Expense** that will conditionally display when **Other** is selected from **Expense Type** dropdown. In this example, the **Other Expense** data should be included in the email content only if the Other Expense field is conditionally displayed on the form.&#x20;

There are two **If** tags being used in the following example. The first will display the Other Expense Label within the header of the HTML table. The second will display the Other Expense submission value within the corresponding row of the table.&#x20;

1. Add a For Loop\
   `{% for X in X %}`
2. Within the For Loop, add the If tag inside the HTML table row (line 12)\
   [`{% if row.expenseType === "other" %}`](#user-content-fn-30)[^30]
3. Add the corresponding result inside the tag (line 15). The row variable is used here to reference data within an array. \
   `{{ row.otherExpense }}`
4. Close out the If tags (line 14)\
   `{% endif %}`

<pre class="language-javascript" data-line-numbers><code class="lang-javascript"><strong>&#x3C;center><a data-footnote-ref href="#user-content-fn-3">&#x3C;h3>&#x3C;b>Expense Report&#x3C;/b>&#x3C;/h3></a>&#x3C;/center>
</strong><a data-footnote-ref href="#user-content-fn-31">&#x3C;table align="center" style="width:75%;"></a>
<a data-footnote-ref href="#user-content-fn-32">&#x3C;th align="left"></a><a data-footnote-ref href="#user-content-fn-33">{{ label("date") }}</a>&#x3C;/th>
&#x3C;th align="left"><a data-footnote-ref href="#user-content-fn-34">{{ label("expenseType") }}</a>&#x3C;/th>
&#x3C;th align="left"><a data-footnote-ref href="#user-content-fn-35">{{ label("otherExpense") }}</a>&#x3C;/th>
&#x3C;th align="left">{{ label("amount") }}&#x3C;/th>
<a data-footnote-ref href="#user-content-fn-36">{% for row in data.expense %}</a>
<strong>&#x3C;tr>
</strong>&#x3C;td>{{ row.date }}&#x3C;/td> 
&#x3C;td>{{ row.expenseType }}&#x3C;/td>
&#x3C;td>
<a data-footnote-ref href="#user-content-fn-37">{% if row.expenseType === "other" %}</a>
<a data-footnote-ref href="#user-content-fn-38">{{ row.otherExpense }}</a>
<a data-footnote-ref href="#user-content-fn-39">{% endif %}</a>&#x3C;/td> 
&#x3C;td>{{ row.amount }}&#x3C;/td> 
&#x3C;/tr>
{% endfor %}
&#x3C;/table>
</code></pre>

**Final Example**

The example below incorporates all of the previous examples using Nunjuck Macros, For loops, and If tags.

<figure><img src="https://501951130-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6LdEf8SjBIeQDsRL3BdV%2Fuploads%2F4BqptTf0kXHFuVVtULqE%2Femailfull.jpg?alt=media&#x26;token=251e3f70-c4e4-4429-8cb3-4299c61055e2" alt="" width="463"><figcaption></figcaption></figure>

```javascript
<h3><b><center>User Information</b></h3></center>
<table align="center" style="width:75%;">
  <tr>
    <td><b>{{ label("employeeName") }}</b></td>
    <td>{{ value("employeeName") }}</td>
  </tr>
  <tr>
    <td><b>{{ label("employeeId") }}</b></td>
    <td>{{ value("employeeId") }}</td>
  </tr>
  <tr>
    <td><b>{{ label("department") }}</b></td>
    <td>{{ value("department") }}</td>
</tr>
<tr>
   {% if data.manager !== "" %}
    <td><b>{{ label("manager")}}</td></b>
    <td>{{value("manager")}}</td>
    {% endif %}
</tr>
</table>
<br>
<br>
<center><h3><b>Expense Report</b></h3></center>
<table align="center" style="width:75%;">
<th align="left">{{ label("date") }}</th>
<th align="left">{{ label("expenseType") }}</th>
<th align="left">{{ label("otherExpense") }}</th>
<th align="left">{{ label("amount") }}</th>
{% for row in data.expense %}
<tr>
<td>{{ row.date }}</td> 
<td>{{ row.expenseType }}</td>
<td>
{% if row.expenseType === "other" %}
{{ row.otherExpense }}
{% endif %}</td> 
<td>{{ row.amount }}</td> 
</tr>
{% endfor %}
</table>
```

## Video

{% embed url="<https://www.loom.com/share/6ed7c0bb30f2466c938774a033ae1b0d>" %}

[^1]: Tags are special blocks that perform operations on sections of the template

[^2]: Macros can be used to  easily render form submission information into your emails

[^3]: HTML Header&#x20;

[^4]: HTML Table

[^5]: Nunjuck Macro outputting the label of the Employee Name<br>

    &#x20;

    employeeName is the property name of the field

[^6]: Nunjuck Macro outputting the submitted data value of the Employee Name<br>

    &#x20;

    employeeName is the property name of the field

[^7]: Nunjuck Macro outputting the label of the Employee ID<br>

    &#x20;

    employeeID is the property name of the field

[^8]: Nunjuck Macro outputting the submitted data value of the Employee ID  <br>

    &#x20;

    employeeID is the property name of the field

[^9]: Nunjuck Macro outputting the label of the Department<br>

    &#x20;

    department is the property name of the field

[^10]: Nunjuck Macro outputting the submitted data value of the Department  <br>

    &#x20;

    department is the property name of the field

[^11]: Nunjuck Macro For Loop

[^12]: Add the variable the For Loop will be referencing&#x20;

[^13]: The array field the For Loop is referencing.

    expense is the Property Name of the Data Grid being used.&#x20;

[^14]: The Property Names of the fields nested inside the Expense Data Grid

[^15]: HTML Header

[^16]: Nunjuck Macro outputting the label of the Date    <br>

    &#x20;

    date is the property name of the field

[^17]: Nunjuck Macro outputting the label of the Expense Type    <br>

    &#x20;

    expenseType is the property name of the field

[^18]: Nunjuck Macro outputting the label of the Amount    <br>

    &#x20;

    amount is the property name of the field

[^19]: For Loop referencing the data in each row of the Expense Data Grid.

    expense is the API Property Name of the DataGrid &#x20;

    <br>

    &#x20;&#x20;

[^20]: row variable and the API Property Name of the fields inside the Grid are used here to reference the row data of the specificed field v &#x20;

[^21]: Nunjuck If tag

[^22]: Use the field's Property Name and data variable within the If tag to reference field data.<br>

    Javascript to check for an empty string &#x20;

    &#x20;

    <br>

    &#x20;&#x20;

[^23]: Nunjuck Macro outputting the label of the Manager<br>

    &#x20;

    &#x20;manager is the property name of the field

[^24]: Nunjuck Macro outputting the submitted data value of the Manager  <br>

    &#x20;

    manager is the property name of the field

[^25]: Close out If tag&#x20;

[^26]: If tag that will execute when the Manager field has a value (is not empty)

    manager is the Property Name of the Manager field&#x20;

    &#x20;

[^27]: Nunjuck Macro that interpolates the Manager field Label

    manager is the Property Name of the Manager field&#x20;

    &#x20;

[^28]: Nunjuck Macro that interpolates the Manager field submission Value &#x20;

    manager is the Property Name of the Manager field

[^29]: Closing the If tag &#x20;

[^30]: Nunjuck If tag.

    row is being used to reference data within an array

    expenseType is the Property Name of field the condition is based on

    other is the value of the Expense Type field the condition will execute on.

[^31]: HTML Table&#x20;

[^32]: Header Cell within the HTML Table &#x20;

[^33]: Nunjuck Macro interpolating the Date field Label

    date is the Property Name of the Data field

    &#x20;

[^34]: Nunjuck Macro interpolating the Expense Type field Label

    expenseType is the Property Name of the Data field

[^35]: If tag condition result which will output the Other Expense Label within the HTML Table column Header     &#x20;

[^36]: Nunjucks For Loop referencing the rows from the Expense Data Grid

    expense is the property name of the Expense Data Grid

[^37]: Nunjuck If tag that will execute a condition when Expense Type has the value Other

[^38]: If tag condition result which will output the Other Expense Value within the HTML Table row&#x20;

[^39]: If tag close out&#x20;
