calculate
Fills a template with the records and settings you send, recalculates it with the template's own formulas, and returns the results: the summary cells listed in get_schema plus the calculated columns of every row you sent. Nothing is saved on the server: the workbook exists only for this request, so calling it again with the same input gives the same output (templates that use TODAY() follow the server's date). Call get_schema first. Sends your records into the template and returns what its own formulas calculate. records: [{sheet, table (index in schema, default 0), rows: [{"": value}]}] fills a record table (only typed/input columns; calculated columns are returned in rows[].calculated). mode: "replace" (default, clears the sample rows first) or "append". cells: {"Sheet name!B3": value} sets settings cells. read: ["Sheet name!B5"] limits which cells come back (default: the sheet results listed in the schema). Dates: send "YYYY-MM-DD". Nothing is stored. Limits: 500 rows, 500 cells, 15 seconds. Fails with a message naming the bad sheet, column or cell, or "unknown template id".
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Template id from list_templates. | |
| mode | No | "replace" (default) clears the template's sample rows before writing yours; "append" adds your rows after them. | |
| read | No | Optional cell addresses to return, for example ["Sheet name!B5"]. Default: the result cells listed in the schema. | |
| cells | No | Settings cells to set, as { "Sheet name!B3": value }. Cells that hold formulas are ignored and reported in warnings. | |
| records | No | Rows to write into record tables: [{ sheet: "sheet name", table?: index in the schema (default 0), rows: [{ "<column header or letter>": value }] }]. Fill input columns only; calculated columns come back in the result. |