Trace where a value came from
audit_cellExplain where one value in a query_aql result came from: the provenance (which import, file, user or write, and when) of every stored value behind the cell, and the calculation if the cell is a function or a total. Read-only. Use it when a number looks wrong or the user asks "where does this figure come from?". For the history of a name's attributes and set membership use name_history instead.
Call it with exactly the rowHeadings, columnHeadings and context you passed to query_aql (the query is re-run to locate the cell), plus the zero-based row and col of the cell in that result's rows array. Example: after query_aql returned rows[2][0] = 1250, pass the same three arrays with row 2, col 0.
Returns headline (the cell and its headings), function (the formula, when calculated) and auditForDisplayList - one entry per provenance: user, method, name (the source, e.g. the file), date, context and the values it supplied (capped at 1000). Returns {message: "cell not found"} when row/col is outside the result. Earlier, overwritten values show only while the database records history (history_settings).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| col | Yes | Zero-based column index of the cell to audit | |
| row | Yes | Zero-based row index of the cell to audit | |
| context | Yes | Context expressions exactly as passed to query_aql - [[]] if that query had none | |
| business | No | Optional. The business this call is for, by name, e.g. "azquo" - it then runs there whatever business the session is in. Worth giving on writes when you work in more than one business: a new MCP session starts in the login's own business. list_businesses shows the names. | |
| database | Yes | Database name, as used for the query_aql call | |
| rowHeadings | Yes | Row heading expressions exactly as passed to query_aql, e.g. [["`Products` children"]] | |
| columnHeadings | Yes | Column heading expressions exactly as passed to query_aql, e.g. [["Sales"], ["Jan", "Feb"]] |