How to generate a PDF invoice with line items, without code
Build a no-code invoice PDF: start from the Invoices & Expenses template, design the page, bind the line items and save the PDF back to each invoice.
Published 12 min read
On this page
- What you will build
- Before you start
- Step 1: Start from the Invoices & Expenses template
- Step 2: Design the PDF in the Templates tab
- Step 3: Create the workflow and bind the header fields
- Step 4: Bind the line-item table with the RECORDID() filter
- Step 5: Add a button action that runs the workflow
- Step 6: Write the PDF link back to an invoice File field
- Step 7: Publish and try it
- Known limits worth knowing up front
- Where to take it next
To generate a PDF invoice with line items without writing code, you need three things: a template that lays out the page, a way to fill it from one invoice and that invoice's line-item rows, and a place to keep the finished file. In Emberblocks those are a PDF template in the Templates tab, a Generate PDF step in a workflow, and a File field on the invoice. This tutorial builds all three on top of the Invoices & Expenses template, which already has invoices, clients and line items with sample data.
At the end, every invoice page has a Generate PDF button. Pressing it builds a PDF with the invoice's number, dates and totals, adds a table of that invoice's line items, and saves the file to the invoice. Plan on about 20 minutes. The PDF templates guide is the reference for each piece if you want more detail than a tutorial gives.
What you will build
| Piece | Where it lives | What it does |
|---|---|---|
| PDF template "Invoice" | Templates tab | Lays out the page: header text with {{variables}} and a line-items table |
| Workflow "Invoice PDF" | Workflows tab | Runs when someone presses the button on an invoice; its one step is Generate PDF |
| Action "Generate PDF" | Actions tab, placed on the invoice page | The button that starts the workflow for the invoice on screen |
| PDF field (File) | Invoices table | Holds the link to the newest PDF of that invoice |
Before you start
- An Emberblocks account. Use this template puts the app in your workspace; sign up first if you do not have one. Open in the editor on the same page gives you a temporary copy without an account if you only want to look around.
- Your plan's document allowance. Every generated PDF counts toward the monthly PDF/CSV documents on your plan; pricing lists the numbers.
- The Line Items table stays as it is. The template's invoice page already lists each invoice's line items with the filter
[Invoice] = RECORDID(). The PDF reuses that exact filter in step 4.
Step 1: Start from the Invoices & Expenses template
Open the Invoices & Expenses template and choose Use this template. Emberblocks creates the app with its sample data in your workspace and opens it in the builder. If you belong to several workspaces, you pick one first.
Two of its four tables matter here. Each invoice is one row in Invoices, and each line on an invoice is one row in Line Items that points back at its invoice through a reference field:
| Table | Fields |
|---|---|
| Invoices | Number, Client, Client email, Issue date, Due date, Status, Subtotal, Tax, Total, Paid on, Notes |
| Line Items | Description, Invoice (a reference to Invoices), Quantity, Unit price, Amount |
The sample invoice 2026-041 for Nordwind Logistics has three line items and a total of 7260, which makes it a good one to test with at the end.
Step 2: Design the PDF in the Templates tab
Open Templates in the builder's left rail, click Add and choose PDF template. A blank A4 page with 20 mm margins opens in the Designer. Set it up first:
- Type
Invoiceinto Template name. - Leave Base on Blank page and pick A4 or Letter in Page size. Margins (mm) sets all four margins at once.
- The Designer's toolbar on the left is a column of icons, and the first one is the text field. Drag it onto the page once for each header line, double-click the new field and type its content. Anything in double braces becomes a variable the workflow fills in.
| Field | Content |
|---|---|
| Title | Invoice {{Number}} |
| Dates | Issued {{Issue date}}, due {{Due date}} |
| Client | Bill to: {{Client email}} |
| Totals | Subtotal {{Subtotal}} Tax {{Tax}} Total {{Total}} |
| Notes | {{Notes}} |
| Your details | Your business name, address and payment details, typed as plain text |
Then drag the second icon, the table, onto the page below the header. A new table starts with three columns (Name, City, Description) and two sample rows. Click inside it to edit it, and small + and - buttons appear. The + at the right end of the header row adds a column, so click it once to get a fourth. Then click each header cell and type the new names: Description, Qty, Unit price and Amount. The sample rows only fill the canvas; the generated PDF replaces them with real line items.
Whichever field is selected, the Edit Field panel on the right shows its settings. Its Name is how the workflow step refers to the field later, so rename the table from field2 (or whatever number it got) to Line items.
Above the canvas, a Variables row lists every placeholder the Designer found: {{Number}}, {{Issue date}}, {{Due date}}, {{Client email}}, {{Subtotal}}, {{Tax}}, {{Total}} and {{Notes}}. Variable names are matched without regard to case, and a variable used in two fields is filled once. The template saves itself as you work.
Keep Editable ticked in the Edit Field panel for every field that holds a variable. It is ticked for new fields. A field that is not editable prints its braces exactly as typed, and the Templates tab lists such fields under the Variables row.
Step 3: Create the workflow and bind the header fields
The template is only a layout. A workflow fills it. Open Workflows, click Add workflow and type Invoice PDF into Name. Then set what starts it:
- Click the Trigger node on the canvas.
- Set Type to Manually (action button).
- Check that Table says Invoices. A new workflow starts on the app's first table, which in this template is already Invoices.
- Click the + under the trigger and choose Generate PDF from the Documents group. The step picks the first PDF template in the app; check that Template says Invoice.
File name is a formula. The default, APPNAME() & " " & NOW() & ".pdf", works, but a name your client recognises is better: "Invoice " & [Number] & ".pdf".
Below it, the step lists every variable from the template, each with a box for its value. Each value is an expression that reads the invoice the button was pressed on. Fill them like this:
| Variable | Value |
|---|---|
{{Number}} | [Number] |
{{Issue date}} | TEXT([Issue date], "DD/MM/YYYY") |
{{Due date}} | TEXT([Due date], "DD/MM/YYYY") |
{{Client email}} | [Client email] |
{{Subtotal}} | [Subtotal] |
{{Tax}} | [Tax] |
{{Total}} | [Total] |
{{Notes}} | [Notes] |
A few things about these formulas. TEXT() formats dates with YYYY, MM and DD; without it, a date prints as 2026-11-29. Amounts print as stored, so 7260 rather than 7,260.00; add a currency with plain text, as in "EUR " & [Total]. A variable you leave empty prints blank, and publish reminds you about it.
Step 4: Bind the line-item table with the RECORDID() filter
Under the variables, the same step shows the table field you drew, labelled Line items (its Designer name) with a Table badge. This is where the line items come in:
- Set Rows from to Line Items.
- The column list is taken from your table design: Description, Qty, Unit price and Amount. For each one, click the + beside its box and pick the field to insert, or type it in braces.
- Type
[Invoice] = RECORDID()into Only rows where…. The hint under the box confirms that RECORDID() refers to the triggering Invoices record. - Leave Sort by on Source order or pick a field, and keep Row limit at 100 unless an invoice can have more lines (the maximum is 500).
| Column | Cell value |
|---|---|
| Description | {{Description}} |
| Qty | {{Quantity}} |
| Unit price | {{Unit price}} |
| Amount | {{Amount}} |
The filter is what makes it an invoice and not a dump of every line item. [Invoice] is the reference field on each Line Items row, and RECORDID() is the id of the invoice the button was pressed on, so only that invoice's lines are kept. It is the same filter the template's invoice page uses for its Line items list. Cells take more than one field and plain text too: {{Quantity}} x {{Unit price}} prints as 2 x 1500.
Step 5: Add a button action that runs the workflow
A manual workflow needs an action to start it. Until one exists, the workflow shows a warning that nothing in the app can start it, with a Create the action button. Click it: Emberblocks creates a Run workflow action on Invoices named "Run Invoice PDF" and opens it in the Actions tab.
- Rename it to
Generate PDF. That is the text on the button. - Optionally set Success message to
"PDF saved to invoice " & [Number]. Messages are expressions, so fixed text goes in quotes. Left empty, the toast says "Workflow ran".
Now put the button on the invoice page. Open Design, find Invoices detail under Hidden in the page list (record pages are not navigation tabs), and click the record block on it. In its settings, open the Actions part and tick Generate PDF under Buttons, next to the template's own Mark sent, Mark paid, Add line item and Void.
Step 6: Write the PDF link back to an invoice File field
So far the PDF is generated and then only listed in the run history. To keep it on the invoice, give Invoices a field for it:
- Open Data, select the Invoices table and click Edit schema. The data source opens in a new tab.
- Expand the Invoices table, click Add column, enter
PDFas the Column name, set Type to File and confirm with Add column. - Back in the builder, the new field joins the Invoices table in your draft. If it does not show up, click Refresh schema on the table in the Data tab.
- Return to the workflow's Generate PDF step and set Save the PDF link to… to PDF. Only text, URL and file fields are offered, each with its type next to it.
- Show the field on the invoice page: in Design, click the record block on Invoices detail again and tick PDF in its Fields part.
A File field shows the PDF as an attachment on the invoice. Every press of the button writes the link of the newest PDF into it, so the field always holds the latest version.
Step 7: Publish and try it
- Switch the workflow on. New workflows start disabled, and the Enabled switch in the workflow's Basics unlocks once it has a step. The switch beside the workflow in the list does the same.
- Publish. Click Publish in the top bar, then Publish version. Publish checks the template and the step together. Broken braces or a table field without columns block it, and each issue is a link that takes you to the setting to fix.
- Open the app with Open Live App, go to All invoices and open invoice 2026-041.
- Press Generate PDF. The toast shows your success message, and the PDF field now holds the file. Open it: the header shows invoice 2026-041 with its dates and a total of 7260, and the table lists its three line items.
If the button reports that the workflow did not finish, open Workflows, select Invoice PDF and look at its Run history (the Runs toggle at the top of the list shows every workflow's runs). Each run lists its steps and the error if one failed, and a step that generated a file shows an Open the generated file link, so the run history is also where to find a PDF when something after it went wrong.
Known limits worth knowing up front
| Limit | What it means for invoices |
|---|---|
| Roboto is the only font | No brand fonts. Characters outside Roboto print as empty boxes, never as a failed PDF. |
| Long tables page-break on blank pages only | A letterhead PDF cuts rows that do not fit on its page; keep long invoices on a blank base. |
| Up to 500 rows and 12 columns per table, 10 MB per file | Plenty for an invoice; a statement of a whole year may need a CSV instead. |
| Step formulas read the triggering row | Values from related tables (the client's name) need their own field on the invoice. |
| Public links | The file opens for anyone with the link. |
| Numbers print unformatted | 7260, not 7,260.00; add currency symbols as text. |
Where to take it next
- Generate on status change. Instead of a button, a workflow with the When data changes trigger and the condition
[Status] = "Sent"can build the PDF each time an invoice is marked Sent. Rows written by a workflow do not start other workflows unless you turn on Trigger other workflows, so the write-back cannot loop. - Add a CSV. A Generate CSV step renders a CSV template over a filtered list of rows, for example every line item of one client, and saves the link the same way.
- Add a logo. An Image field in the Designer binds to a URL formula, such as the link to a logo you host.
- Reuse the pattern. Packing slips, quotes, work orders and certificates are all a header plus a record-scoped table: the same steps on a different pair of tables. The spreadsheet to app guide covers setting up those related tables if you are starting from a sheet.
Questions people ask
- Can I generate a PDF invoice without writing code?
- Yes. Design the page in a visual PDF designer, type
{{variables}}where invoice values go, and let a workflow's Generate PDF step fill them with formulas such as[Number]and[Total]. No scripts or PDF libraries are involved. - How do the line items get into the PDF?
- A table field in the template is bound to the Line Items table with the filter
[Invoice] = RECORDID(). That keeps only the rows that belong to the invoice the workflow ran for, one table row per line item, up to 500 rows. - Can I use my company letterhead?
- Yes. Upload a PDF as the template's base and place fields on top of it. Tables only continue onto extra pages on a blank base, so on a letterhead the rows past the bottom of the page are cut off, and publish warns about it.
- Can I use my own font?
- Not yet. Every PDF renders in Roboto. Characters Roboto does not cover print as empty boxes rather than breaking the PDF.
- Is the PDF emailed to the client?
- Not in this tutorial. The PDF is saved on the invoice and listed in the workflow's run history. A Send email step can attach files generated earlier in the same run, but it is not part of these steps.
- Where is a generated PDF stored, and who can open it?
- In Emberblocks file storage, at a public link with a long unguessable path. The link is written to the invoice's PDF field and to the run history, and anyone who has it can open the file.
Written by Apostolos Papadopoulos
Apostolos builds Emberblocks, a visual app builder for internal tools on your own data, from Thessaloniki, Greece. Spotted something wrong or out of date? Write to hello@emberblocks.com.