Use Case-invoice-automation

Invoice Automation with CustomJS

Introduction

With CustomJS, you can set up automated invoice actions that integrate with various platforms. In this article, we'll explore how to use CustomJS to implement invoice automation with Salesforce, Airtable, Google Spreadsheet, and Asana, by executing the CustomJS function via links or webhooks. All code examples can also be found as templates when creating a function.

Why CustomJS?

CustomJS is a flexible solution that allows you to run JavaScript to create custom PDF automations and integrations. One of the powerful features of CustomJS is its ability to generate invoices via various integrations, using dynamic values from different data sources. These invoice actions can be triggered manually by team members, providing flexibility and control over the invoicing process.

Invoice PDF Generation
Invoice PDF Generation

How it works

We use html templates that we provide with dynamic content using the template engine nunjucks. After that we use the CustomJS helper to generate a PDF from a HTML string. You can find the entire HTML layout as a template when creating a new function in CustomJS.

const { HTML2PDF } = require("./utils");
const nunjucks = require("nunjucks");

const content = nunjucks.renderString(variables["HTML Template"], {
  invoiceNumber: input.invoiceNumber,
});

return await HTML2PDF(content);

Integrating CustomJS with platforms like Salesforce, Airtable, Google Spreadsheet, and Asana allows you to create powerful invoice automation workflows. These integrations can be manually triggered by team members, providing flexibility and control over the invoicing process. Explore the provided links to learn more about each integration and start enhancing your invoice automation processes today.


Use Cases