Introduction
The Context object (ctx) provides a powerful API for programmatically interacting with your spreadsheet. It allows you to read and write cell values, manipulate rows, navigate between sheets, and orchestrate complex workflows—all from within your column formulas.
Available APIs
This Row
Get and set values on the current row
This Cell
Access and modify the currently executing cell
Sheets
Add rows and query data across sheets
Cells & Rows
Direct access to any cell or row by ID or value
Utilities
Helper functions for common data transformations
Workflow Control
Orchestrate execution with sleep and halt
Webhooks
Receive and process HTTP requests in your spreadsheet
Getting Started
Thectx object is automatically available in all column formulas:
Key Features
- Row Operations: Read and write data on the current row or any row in the sheet
- Cross-Sheet Access: Push data between sheets and query related records
- Foreign Key Navigation: Use dot notation to traverse relationships (e.g.,
Companies.Owner.name) - Workflow Control: Optimize execution with
halt()for early termination signals - Type Safety: Column names and sheet names are validated at runtime
- Metadata Management: Store custom metadata on cells for advanced use cases
Context Properties
Thectx object includes several key properties:
ctx.rowId- UUID of the current rowctx.colId- UUID of the current columnctx.thisRow- Helpers for the current rowctx.thisCell- Helpers for the current cell (unavailable in webhooks)ctx.thisColumn- Helpers for the current columnctx.thisSheet- Helpers scoped to the current sheetctx.utils- Utility functions for data transformation