Create a dataset from JSON rows
create_datasetTurn JSON rows into a dataset for batch PDF rendering, returning the dataset ID and column keys for template placeholders.
Instructions
SheetRender turns HTML templates plus spreadsheet rows into rendered PDFs. This tool turns rows you already hold — as JSON — into a dataset a batch job can render, and returns the dataset id plus the column keys.
This is the normal way to start a batch: the user asks for "an invoice for each of these clients" or "a letter per employee", you assemble the rows, and this uploads them. Use upload_dataset instead when the data is already a file on disk, and list_datasets when the user is referring to a dataset that already exists.
rows is a flat array of flat objects, one per document: [{"client": "Acme", "total": 42}, {"client": "Globex", "total": 17}]. The header is the union of every row's keys in first-seen order, so rows need not agree on their keys — a missing one is a blank cell, not a shifted row. Values must be strings, numbers, booleans or null; nested objects and arrays are rejected, so flatten or stringify them first. So are NaN, Infinity and whole numbers past 2^53 (send those as strings to keep them exact).
The dataset is attached to the template's project, which means every template in that project can render it and it stays available to later jobs.
Limits: 50,000 rows and 500,000 cells (rows x columns) per call. The row cap applies to JSON rows only — a bigger sheet can still go through upload_dataset as a file, which is bounded by size and cells rather than rows. Creating a dataset is free; only rendering counts against the account's plan.
Returns the dataset id and, for each column, the sanitized key. That key — not the original header — is what the template's placeholders, filename_template and group_by address, so read it off this result rather than guessing from the header text.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Optional label for the dataset, used as its stored filename so the user recognises it later, e.g. "march-invoices". | |
| rows | Yes | One flat object per document. Keys become spreadsheet columns; values must be scalars (string, number, boolean or null). | |
| template_id | Yes | Template id from list_templates. The dataset lands in that template's project. |