File: Custom Document

Knowledge Center > Workflow > Workflow Tasks > File: Custom Document

File: Custom Document

Table of contents

The custom document task generates an invoice based on the HTML template that you provide in the task. This task is similar to the Custom Invoice task. The only difference is that the custom document task does not attach the generated invoice to an object record.

You can customize your invoice template using HTML tags, CSS, images, JavaScript and Liquid expressions.


In upstream tasks, you need to retrieve the data fields you want to include in the template.

Use JavaScript or Liquid to add logic or data to the template. You can also reference external JavaScript libraries.


Liquid expressions start with '{%' and end with '%}'.

This code block uses Liquid to pass data to a JavaScript constant object.

const usages =  {% if Data.Usage %}
    {{- Data.Usage | to_json -}};
{%- else -%}
{%- endif -%}

The following code block adds data to a div element. Depending on the value of a data field, it adds different strings to the div element.

 <div style='font-size: 10px'>
{%- if Data.Invoice[0].InvoiceNumber and Data.Invoice[0].InvoiceNumber != "" -%} 
{{- Data.Invoice[0].InvoiceNumber }}
{%- else -%}0001{%- endif -%}

For a complete use case and template code examples, see the "Custom Invoice" workflow template under the Invoicing category. This template is explained in Customize invoice templates using HTML.


If the task runs successfully, you can view the output in the Tasks tab. Click the menu icon on the left of the task and hover on Files. You can select either the HTML or PDF version of the invoice. The PDF file is generated based on the HTML file. If you want to do one-time changes, you can modify the HTML file and then generate a PDF file based on the HTML file. 



Last modified



(not set)