Word Document (DOCX) & PowerPoint (PPTX)

This section helps you to generate dynamic Word documents and PowerPoint.

Getting Started

You can use Word Documents or PowerPoint ( .docx, .pptx is the supported format ) as your document template, you can build your document in Ms Word, Google Docs or Zoho Writer and then upload it to Docupilot as a .docx or .pptx file. If you are already using a word document for your business, replace the information that will change like client company name, client name to {{client.name}}, {{client.company}}.

Uploading DOCX

Updating DOCX

If you want to make changes to your Word document make changes in MS Word, Google Docs, Zoho Writer etc , and upload it to Docupilot as a .docx file.

You cannot modify your Word Document template inside Docupilot.

Types of Merge Fields

Docupilot supports a variety of merge fields for you to use.

  • Tokens (Merge Field)

  • Condition (if-else & unless-else)

  • Loops

  • Tables

Tokens (Merge Field)

These are simple fields embraced in {{}}. When you provide your custom data, Docupilot will replace these fields with the data. For example {{email}}, {{clientname}}, {{company_name}}.

If you want to group your fields you can use dot(.) while defining the tokens. For example your client has first name & last name, you can write the tokens as {{client.first_name}}, {{client.last_name}}.

Condition (if-else & unless-else)

You can use conditional statements to show or hide contents based on your data. For example, If you are creating an invoice you want to display PAID if the payment status field is paid, else you want to show UNPAID.

{{#if payment_status "==" "paid"}}
PAID
{{else if payment_status "==" "partial"}}
PARTIAL PAID
{{else}}
UNPAID, Insert Payment Instruction{{/if}}
{{#unless payment_status "in" "paid, partial"}}
UNPAID, Insert Payment Instruction
{{else unless payment_status "==" "paid"}}
PARTIAL PAID
{{else}}
PAID
{{/unless}} 

You can use the conditional statements in three ways

  • if Statement.

  • if-else Statement.

  • if-else if-else Statement

  • unless Statement

  • unless-else Statement

  • unless-else unless-else Statement

Below are a few examples :

Example

Description

{{#if payment_status}}

{{/if}}

if payment_status is not empty or blank.

{{#if payment_status "==" "paid"}}

{{/if}}

if payment_status equal to paid (case-sensitive).

{{#if payment_status "!=" "paid"}}

{{/if}}

if payment_status not equal to paid (case-sensitive).

{{#if price ">" 1000}}

{{/if}}

If price greater than 1000

{{#if price ">=" 1000}}

{{/if}}

If price greater than and equal to 1000

{{#if price "<" 1000}}

{{/if}}

If price lesser than 1000

{{#if price "<=" 1000}}

{{/if}}

If price lesser than 1000

{{#if payment_status "contains" "paid"}} {{/if}}

If payment status contains paid

{{#if payment_status "not_contains" "paid"}} {{/if}}

If payment status does not contains paid

{{#if status "in" "open, on-hold"}}

{{/if}}

This is similar to logical operator OR.

If status is open or on-hold.

{{#if status "not_in" "open, on-hold"}}

{{/if}}

This is similar to inverse logical operator OR.

If status is not open or on-hold.

{{#if status "==" "open"}}{{#if priority "==" "high"}}

{{/if}}{{/if}}

This is similar to logical operator AND.

If status is open AND priority is high

{{#unless payment_status}}

{{/unless}}

unless payment_status is not empty or blank.

{{#unless payment_status "==" "paid"}}

{{/unless}}

unless payment_status is equal to paid(case-sensitive).

{{#unless payment_status "!=" "paid"}}

{{/unless}}

unless payment_status is not equal to paid(case-sensitive).

{{#unless price ">" 1000}}

{{/unless}}

unless price greater than 1000

{{#unless payment_status "not_contains" "paid"}} {{/unless}}

unless payment_status does not contain paid.

{{#unless status "in" "open, on-hold"}}

{{/unless}}

This is similar to logical or operator. Unless the status is open or on-hold.

Hiding Empty Sections & Lines

You can use IF to hide sections/lines that do not have a value. Hide section example

1. Name: {{name}}
   {{#if address}}Address: {{address}}{{/if}}
2. Name:{{name}}   
   {{#unless address "==" ""}}Address: {{address}}{{/unless}}

In the above example when the Address is empty, the Address section will be removed.Hide empty lines example

1. {{name}}{{#if address}}
   {{address}}{{/if}}
   {{city}}{{country}}
2. {{name}}{{#unless address "==" ""}}
   {{address}}{{/unless}}
   {{city}}{{country}} 

In the above example when the Address is empty, the Address empty line will be removed to achieve better document formatting.

Lists (Loops)

Lists are used when you want to print a list of items in your document.

  • Simple List

  • Advanced List

  • Bulleted List

  • Numbered List

Simple List

{{#each items}}
{{this}}
{{/each}}
Output
Apple
Orange
Strawberry

Advanced List

You can use an advanced loop if you want to print list of items like line items. Think of this as a subform with multiple rows in your main form.

{{#each line_items}}
{{name}} ${{price}}
{{/each}}
Output
Iphone6 $799
Iphone7 $899
Iphone8 $999

Bulleted List

Nested Bullets:

Bulleted lists can be nested so as to have a multi layered information.

For example, below syntax demonstrates nested list up to 2 levels.

Note : The second level will be printed only when products has at least one entry.

Similarly, for a nested list up to 3 levels.

Note : In the above example second and third levels will be printed only when items and sub_categories have at least one entry.

Note : The above syntax can be extended for multiple levels based on requirement.

Numbered List

Tables

Tables are similar to Complex list, but the data will be rendered in a table. Example if you want to generate a invoice, you may want display a table with all the line items.

Hiding Empty Tables

You can use IF condition to hide empty tables, you should wrap the entire table inside a IF condition.

{{#if line_items}}
{{!...INSERT THE ABOVE TABLE IN THIS LINE...}}
{{/if}}

Filtering rows in a Table based on empty column value

Filtering rows in a Table based on a column value

Inserting a dynamic image

This will be helpful if you want to insert dynamic image in the document.

Format - {{insert_image image1 width="width" height="height"}}

Example - {{insert_image image1 width="300" height="300"}}

If you want to automatically adjust the height to keep proportions, you can use:

Example - {{insert_image image1 width="300"}}

Similarly to automatically adjust the width to keep proportions, you can use:

Example - {{insert_image image1 height="300"}}

The image URL need to be publicly accessible so we can download and insert it in the document.

Inserting a dynamic QR Code

This will be helpful if you want to insert dynamic QR code from your data in the document.

Format - {{insert_qr url size="qr_size" margin="qr_margin" color="qr_color"}}

Example - {{insert_qr url size="100" margin="1"}}

Example - {{insert_qr url size="100"}}

Example: {{insert_qr url margin="7"}}

Example: {{insert_qr url color="0000FF"}}

The color of the QR should be given in hex coding only.

Inserting Google Maps

This will be helpful if you want to insert Google Maps from your data in the document.‌

Format - {{insert_map Location width="map_width" height="map_height" map_type="maptype" zoom="map_zoom"}}

The supported map types are as follows. The default map type is the roadmap.‌

  1. roadmap

  2. satellite

  3. hybrid

  4. terrain

Example - {{insert_map Location width="500" height="500" map_type="roadmap"}}

Example: {{insert_map Location map_type="roadmap" zoom= "20"}}

Example: {{insert_map Location height="300" zoom= "5"}}

Grid Helper

The Grid Helper will render the list input in a grid format, with specified column size.

Syntax: {{#grid items col_size=3}} {{@item1}}{{@item2}{{@item3}} {{/grid}}

Example:

If the number of columns ( i.e.,col_size) is 5, then {{@item4}} and {{@item5}} can be used to access entries 4th and 5th column items in each row.

Rich Text Helper

The rich text helper enables content formatting in various ways, including bold, italic, underlined text, different fonts, sizes, colors, and more, surpassing plain text capabilities.It supports both HTML and Markdown format input to richtext.

Embedding Fonts in a DOCX Template:

To ensure a document retains a specific font that is not supported on our end, you must embed the fonts within the document. This will make sure that the generated document maintains the same font as the original.

Here's how to embed fonts in your DOCX template:

  1. Open Your DOCX Template: Begin by opening your template using Microsoft Office.

  2. Enable Font Embedding:

    • For Mac Users: Navigate to Preferences -> Save -> "Embed fonts in the file."

    • For Windows Users: Go to Options -> Save ->"Embed fonts in the file".

    If you're having trouble locating these settings within Microsoft Office, refer to this article for guidance.

  3. Save and Upload: Finally, save your document with the embedded fonts and upload the updated document to Docupilot.

Comments

You can add comments in the document template to help your future editors. The comments will be removed in the output document.

Comments Syntax : {{!Your comments here}}

Last updated