Skip to content

Generate a template from data

Already have the data but not the document? Upload a CSV, Excel, or JSON file, describe what you want in a sentence or two, and Pagr’s AI designs a template around your fields — turning a spreadsheet of records into a ready-to-render document.

It’s one of the four Start from options in the New template panel, alongside Blank template, From an example, and From a document. Like From a document, its tile is badged AI — an AI model designs the layout, so it spends AI tokens.

Drop a file onto the upload area, or click to browse. Pagr accepts:

  • A CSV file
  • An Excel spreadsheet
  • A JSON file

The file must be 10 MB or smaller. Pagr reads the file’s columns (or JSON fields) and infers a type for each one — text, number, or date.

  1. On the Templates page, click + New Template (you can also start from the Dashboard).

  2. Under Start from, choose From a data file“Design a document around your CSV, Excel or JSON”.

    The New template panel’s Start from list, with the From a data file tile highlighted alongside Blank template, From an example, and From a document

  3. Upload your data file — drag it onto the upload area or click to browse and pick it from your device.

  4. Check the details and generate. Pagr shows the file with its size and record count, fills in the Template name from the filename — change it if you want — then choose the Project the template belongs to and describe the document under What should the document show?. Data model summarises the fields Pagr found; expand it to check them. Open More options if you want to pick a different Model quality. Click Create template to start.

The From a data file panel before uploading: an empty upload area reading Drop a CSV, Excel or JSON file, or click to browse, max 10 MB The same panel after uploading: customer_financial_data.csv attached with a note that the file holds 10 records and the template is designed for one of them, the template name filled in from the filename, a project selected, a description of the document, a collapsed Data model reading 1 collections and 9 fields detected, and More options expanded on Model quality with Premium chosen

Create template stays greyed out until you’ve attached a file — so if you can’t click it, start with the upload.

Your description is the only thing the AI has to work from, so the more specific you are about tone, sections, and layout, the closer the first result will be — for example “Give an overview of the portfolio of the customer. Include a pie chart and some numbers.” It’s also saved as the template’s description.

Under More options, Model quality decides which AI model designs your document:

  • Standard — faster, and right for most documents.
  • Premium — slower, but better with dense or unusual layouts. It’s a larger model with more room to work in, so it holds a file with many fields or an intricate layout together where Standard starts simplifying.

Premium is only offered on plans that include it. On a plan without it there’s nothing to choose — the option simply isn’t shown, and every generation uses Standard. See Billing for what your plan covers.

When generation finishes, the new template opens in the template editor with your description turned into a full layout, each of its placeholders already bound to a field from your file.

The generated Portfolio Overview page in the editor: a branded header, two balance boxes, an asset allocation donut chart, an Account Details table and a total assets line, with every bound element outlined and labelled with the data field it uses

From here it behaves like any other template:

  • Refine the layout and wording with the AI Assistant (“add the report reference to the header”, “make the record table wider”).
  • Adjust the document name on the Properties tab — see Naming rendered documents by record below.
  • Render it to produce documents, and publish a version once you’re happy.

Because the template is bound to a single record, rendering it once — from the version row on the Templates list, or from Test / Production in the editor — produces one document from the sample data.

To generate a document per row instead, open the render dialog and attach the same kind of file under Data file (optional):

  • With no file attached, Pagr renders a single document from the template’s own sample data. The dialog shows an editable box per top-level field — a JSON box for a collection, a plain input for a single value — so you can tweak the record before rendering.

    The Production Render dialog with no data file attached, showing the sample record as an editable JSON box and a separate number input, above a Render button

  • Attach a CSV, Excel, or JSON file in the same shape as the template’s sample data, and Pagr detects every row, confirms how many documents it will produce, and changes the button to Render N documents.

    The Production Render dialog with a 100-row file attached, showing the detected rows and the Render 100 documents button

Click it, and Pagr renders one document per row. When it finishes, download every document at once as a single archive.

A success banner reading 100 documents rendered, 100 pages, with a Download all (ZIP) button

With one render producing many documents, giving them all the same name isn’t useful. On the Properties tab, set the Document name to include a placeholder from your data — a fixed prefix plus a field that differs per record, like DSAR_{{customers100.index}} below — so each rendered file is named after its own record instead of colliding on the template name.

The Properties tab with the document name set to a template name prefix plus a placeholder from the record’s index field

Type {{ in the field to pick a placeholder from the data object, the same way you would for any other template. See Editing a template by hand.