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
| Parameter | Type | Description |
|---|---|---|
workview | string | The workview's name or id. |
titleDimensions | string[] | The title dimensions' names or ids. |
titleElements | string[] | The element to select for each title dimension, in the same order. |
Returns
stringThe 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);
}