Skip to main content

Create an invoice PDF

Create an invoice PDF when an installation is marked Completed. Tape fills a template with record values and emails the PDF to the customer.

Written by Leo

This recipe turns a record into a document. Create PDF renders an HTML template with the values of the record, and Send email attaches the file. It's meant to send invoices the moment work is finished, without a manual export.

Automation editor for Installations with the trigger When a record is updated and Status has changed, the filter Where Status Has changed to Completed, and the action Create a PDF with the file name Invoice - Customer.pdf and a template that lists the customer, the system size, and the total

What you'll need

  • An Installations database app with these fields:

  • Customer, a text field

  • Customer email, an email field

  • System size (kW) and Total, number fields

  • Status, a status field with the option Completed

Build the automation

  1. Open the Installations app and click the automations icon at the top right (Create and view automations).

  2. Select New automation, then select When a record is updated.

  3. In the trigger, select the field name and choose Status under FIELDS.

  4. Under And if the following conditions are met, select Add filter. Pick Status, then Has changed to, then Completed.

  5. Select Add action → Create PDF. The action reads Create a PDF and save file in PDF.

  6. In File name, enter "Invoice - " and insert the Customer field, followed by ".pdf".

  7. Write the template in the editor. Enter a heading such as "Invoice", then lines for the customer, the system size, and the total, inserting each field. Select Show more for page size, orientation, and margins. Select Show preview to check the layout. If the invoice needs them, click ••• on the action and turn on Header and footer or Page numbers under Settings.

  8. Select Add action → Send email.

  9. In To, insert the Customer email field. In Subject, enter "Your invoice from Acme Solar".

  10. Write a short message. Select Show more, then Attach file, open Select a field, and choose PDF, the file saved by Create PDF. Leave All files selected.

  11. Select Create automation.

The Send an email action with To set to the customer email of the installation, the subject Your invoice from Acme Solar, Attach file set to PDF with All files, and a short message that greets the customer

Note: The email goes to a real customer when the status changes. Test with your own address in Customer email.

The result

When an installation is set to Completed, the customer receives an email with the invoice attached, for example Invoice - Dana Whitfield.pdf, with the customer, system size, and total filled in.

Variations

  • Add Update record to store the invoice date or number on the installation.

  • Send a copy to your accounting inbox with Cc, which you find under Show more.

  • Start the PDF from a single select field such as Next step → Create invoice instead of a status change.

  • Use a table in the template to list line items. Learn how to format emails and PDFs with HTML →

Learn more

FAQs

Is the PDF saved in the record?

No, not by itself. Create PDF saves the file in the variable PDF for later actions, such as an email attachment. To keep it on the record, add Update record and add PDF to a file field with Add files.

Can I change the page size?

Yes! Select Show more and choose from sizes such as Letter, Legal, Tabloid, A3, A4, or A5, portrait or landscape, and the margins.

Are you a developer using the Tape API for automations?

The automation API has its own documentation for developers. Full reference: create_pdf in the developer docs →

Still have questions? Find answers and get help from community experts in the Tape community →

Did this answer your question?