Excel File(XLSX)
This section helps you to generate dynamic Excel Spread Sheets.
Last updated
This section helps you to generate dynamic Excel Spread Sheets.
Last updated
You can use Excel Spread Sheets ( .xlsx is the supported format ) as your document template, you can build your document in Ms Excel, Google Sheets or other supporting platforms and then upload it to Docupilot as a .xlsx file. Replace the info in excel sheet like client name, client company name to {{client.name}} and {{client.company}}.
If you want to make changes to your Excel Spread Sheet make changes in MS Excel, Google Sheets etc , and upload it to Docupilot as a .xlsx file.
Docupilot supports a variety of merge fields for you to use.
Tokens (Merge Field)
Condition (if-else
& unless-else
)
Iterating inside a cell
Tables
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}}.
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 CASH if the payment_mode is cash, else if the payment_mode is the card you want to show CARD.
Note: The if/else & unless/else
statements work only when incorporated in a single cell (i.e. the whole statement shall end in a single cell in an excel sheet).
You can use the conditional statements in the following 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 is not empty or blank. |
| if payment_status equal to paid (case-sensitive). |
| if payment_status not equal to paid (case-sensitive). |
| If price greater than 1000 |
| If price greater than and equal to 1000 |
| If price lesser than 1000 |
| If price lesser than 1000 |
| If payment status contains paid |
| If payment status does not contains paid |
| This is similar to logical operator OR. If status is open or on-hold. |
| This is similar to inverse logical operator OR. If status is not open or on-hold. |
| This is similar to the logical operator AND. If the status is open AND priority is high. |
| Unless payment_status is not empty or blank. |
| Unless payment_status is equal to paid (case-sensitive). |
| Unless payment_status is not equal to paid (case-sensitive). |
| Unless price is greater than 1000 |
| Unless payment status contains paid |
| This is similar to the logical operator OR. Unless the status is open or on-hold. |
| This is similar to the logical operator AND. Unless status is open AND priority is high |
You can use If/Unless to hide sections/lines that do not have a value. Hide section example
In the above examples when the Address is empty, the Address section will be removed. Hide empty lines examples
In the above example when the Address is empty, the Address empty line will be removed to achieve better document formatting.
Multiple entries inside a cell can be incorporated by using the following syntax.
The Format for inserting tables into a XLSX file or an Excel Spreadsheet is as follows.
{{table:ITEMS.PROPERTY}}
Example :
{{table:line_items.name}}
{{table:line_items.qty}}
{{table:line_items.amount}}
Here for the field namedline_items
we have name
,amount
and qty
as the properties.
Example : In the below example we can see that there are fields Name
,Price
and Quantity
in the table line_items
.
An image can be dynamically added into XLSX template from a URL. The URL should be a publicly avaialble URL. To add image dynamically, add the following syntax in one of the desired cells:
Syntax : {{insert_image image width="width" height="height"}}
Example: {{insert_image image width=300 height=300}}
If you want to automatically adjust the height to keep proportions, you can use: {{insert_image image width=300}}
Similarly to automatically adjust the width to keep proportions, you can use {{insert_image image height=300}}
The image inserted will be aligned to the cell top left corner.
The image URL needs to be publicly accessible so we can download and insert it in the document.
To insert images from google drive, reach out to our support.