Skip to content

workview.execute ​

Runs a workview with the given title elements, as the user running the process, and returns its results.

js
workview.execute(workview, titleDimensions, titleElements)

Parameters ​

ParameterTypeDescription
workviewstringThe workview's name or id.
titleDimensionsstring[]The title dimensions' names or ids.
titleElementsstring[]The element to select for each title dimension, in the same order.

Returns ​

string

The results, as a JSON string, with the workview's rows, columns and cells. Use JSON.parse() to read it. Returns a string starting with "Error:" when the workview, or a title dimension, can't be found, so check for that before parsing.

Examples ​

js
const result = workview.execute("Monthly P&L", ["Year", "Month"], ["2026", "Jan"]);
if (!result.startsWith("Error:")) {
    const grid = JSON.parse(result);
}