Query and compute cells

Write SQL query cells and JavaScript compute cells in a notebook, run them, and use their results in other cells.

Edit NotebooksUpdated in Intuidy 2026.11.215 min read

Use a query cell to run SQL against a connected database, and a compute cell to run JavaScript over the rows that other cells return.

Before you start

Write and run a query cell

  1. Open a notebook from Notebooks.
  2. Select Insert → SQL Query Cell.
  3. Enter a title in place of Untitled query.
  4. Enter your SQL in the cell.
  5. Select Run query, or press CtrlCommand + EnterReturn.

The rows appear under Results. A query that returns nothing shows No rows. Longer results are split into pages.

A query cell holds one SQL statement, for example:

sql
SELECT region, SUM(total) AS revenue
FROM orders
GROUP BY region
ORDER BY revenue DESC;

The cell also has these options:

OptionWhat it does
Table, Bar, Line, PieShows the results as rows or as a chart.
Download CSVDownloads the results as a CSV file.
AI GenerateOpens a prompt where you describe the query you want, such as "Show top 10 customers by revenue", and writes the SQL. See AI sections.
BigQuery projectFor a BigQuery connection, sets the Google Cloud project the query runs in.
Delete cellRemoves the cell from the notebook.

Find tables and columns

The Database Explorer lists your Connected Databases. Use it to check table and column names before you write SQL.

If a database shows Re-authenticate, select it and sign in to that system again.

Write and run a compute cell

  1. Select Insert → Compute Cell (JS).
  2. Enter a title in place of Untitled compute.
  3. Under Inputs, choose the cells whose rows your code reads.
  4. Enter your JavaScript in the cell.
  5. Select Run, or press CtrlCommand + EnterReturn.

The cell shows not run until you run it. Its output can then feed chart, pivot table, and metric cells, and other compute cells.

Run every cell

A cell whose last run failed shows last run failed. Select Run again to retry it.

Use the results in other cells

Chart, pivot table, and metric cells read their rows from a source cell. Add them from Insert → Chart Cell, Insert → Pivot Table, or Insert → Metric Cell.

Re-run cells on a schedule

  1. Select Notebook → Scheduled Refresh….
  2. Choose an interval, from Every 15 minutes to Weekly.
  3. Select Save.

The notebook re-runs every SQL, compute, and workflow cell at that interval and saves the results. Mark results stale after (hours) sets how old saved results can get before they are marked stale. To stop the schedule, choose Never run on a schedule.

Note

A scheduled run reads shared database connections only. A cell on a private connection still runs when you run it yourself, but fails on the schedule. To include it, see Share a connection.

Troubleshooting

↳ AI sections ↳ Embed tiles ↳ Co-editing and export