Skip to content

Generate Excel files with repeating rows

How-to6 minPractitioner

Before you start

Use an Excel template when the result is a table: every line of a purchase order, every invoice of a vendor. You design the workbook in Excel, mark where values go, and a workflow produces an .xlsx and attaches it to the record.

Build the sheet as you want to see it: titles, headers, number formats and column widths. Then add two kinds of placeholder.

Single values. Type a field’s system name inside ${ } in any cell, for example ${vendor_name} or ${po_number}. Give the whole placeholder one formatting so it is filled.

A repeating row. In one row, put placeholders written as the list name, a dot and the field.

ItemQuantityUnit price
${lines.item}${lines.quantity}${lines.unit_price}

Beezr copies that row for every record in the list and removes it when the list is empty. For a module with line items, the Fields tab shows the list name and copies each placeholder for you.

  1. In the left rail, click Document generation, then New template.
  2. Choose Excel, type the Name, for example PO lines, and choose the Module. Click Continue.
  3. Drop the .xlsx on Drop your Excel file here, or click it to browse.
  4. Click Save.

Use an .xlsx file . After saving, Placeholders found lists each placeholder as a Value or a Repeating row, and where it will be filled from.

Beezr reads the file when you save it. If you change the workbook later, click Replace and Save again.

In the workflow, add a Smart document step on the same module and choose the template. For a repeating row, the step asks you to Choose a list, one of the lists made earlier in the workflow, such as the records a Load data step returned. “Every row of the list prints, one per table row.” Single values take a field or a Smart Script. Smart document covers the step.

An Excel template tied to a module. The workflow’s file keeps your layout, shows the single values and has one row for each record in the list. It is attached to the record that started the workflow.

Check yourself

A purchase order has 6 lines and the template row holds the lines placeholders. How many rows does the finished sheet have for the lines?
Show the answer

6. Beezr copies the template row once for every record in the list.

Layla has her price sheet in an old .xls file. What does she upload to an Excel template?
Show the answer

A .xlsx workbook, saved from Excel. Excel templates use .xlsx workbooks. Save the sheet from Excel as a .xlsx file first.

What's next

Last checked