Skip to content

Actions in the classic Workbook Editor

21 min read · Updated 26 Nov 2026

This page covers actions in workbooks built with the classic Workbook Editor. A Data App has no Actions editor: it handles interactions in its own code and runs Business Workflows authored in the semantic layer.

An action is a stack of blocks that runs when something happens in a workbook: a viewer selects a button, a filter changes, a timer fires or a sheet opens. You build it in the Actions editor by dragging blocks from a catalog and snapping them together. For what each block does, see Action blocks.

Every action has three parts:

  • A trigger starts it. Triggers are in the Controls, Events and Embeds categories, for example When object emits event do, Enter: sheet or Before workbook opens. A trigger must be the first block in the stack.
  • Logic is optional. Blocks such as if, if / else and Switch choose which blocks run, and operators compare or combine values.
  • Outcomes change the workbook: go to a sheet, set or clear filters, set a variable, refresh data, write back to your warehouse, send a notification or produce a report.

For example, a regional sales sheet has a button for each region. Each button’s action starts with a When button emits On click do trigger and holds three outcomes: Set filter narrows the workbook to that region, Set variable to stores the choice, and Go to opens the regional detail sheet.

Actions belong to the whole workbook, so a trigger can react to an object on any sheet. They run only when the workbook is viewed: in Preview workbook or Preview sheet, as the published workbook, or in an embed. They do not run on the edit canvas.

  1. Open the workbook in edit mode.
  2. In the toolbar on the left of the editor, select Actions.

Classic Workbook Editor with the Actions item highlighted in the toolbar on the left, below Layers and Variables.

A button’s Style tab, and the Data tab of an input object, also have an Actions section with an Actions button that opens the same editor.

A selected button on the canvas, with the Actions button below Button text, Background and Border on the Style tab.

The block catalog is on the left and the canvas is in the middle. Until a workspace has blocks, the canvas reads You haven’t added any action blocks here yet.; select Get started to open the catalog.

You can spread actions over several workspaces to keep them findable. All workspaces apply to the whole workbook.

The Organize: dropdown at the top of the editor lists the workspaces. Select Add Workspace to add one, or open the menu beside a workspace for Rename, Copy, Duplicate and Delete. Delete is unavailable while the workbook has only one workspace.

Organize dropdown listing My Action Workspace and Add Workspace, with the workspace menu open on Rename, Copy, Duplicate and a disabled Delete.

The toolbar on the right holds Copy and Paste, Undo and Redo, a menu to expand or collapse all blocks, Add Comment, Fit to screen and the zoom controls. The keyboard icon lists the editor’s shortcuts.

  1. In the catalog, open a Triggers category and drag a trigger onto the canvas.
  2. Drag the blocks that should run into the trigger, in the order they should run. Blocks in a stack run from top to bottom.
  3. Set each block’s fields and dropdowns, such as the sheet, field, values or variable.
  4. Preview the workbook and try the action.

A block connects only where it fits the flow. A block that returns a value fits only an input that accepts that type, such as a number or a Boolean. A connected block with an invalid value, such as a trigger that refers to a button that no longer exists, is drawn in red and cannot run.

To detach a block, drag it away; with Alt (⌥ on a Mac) held, you move one block without the blocks below it. To remove a block, drag it back to the catalog, or select it and press Delete. Blocks that are not attached to a trigger do not run, so you can park a block on the side of the canvas.

The catalog groups categories under these headings. Some categories appear only when the matching feature is enabled for your account.

Group Categories
Triggers Controls, Events, Embeds
Workbook Navigation, Filter / Data, Objects, Variables, Export, Other
Workflows Writeback & SQL; when enabled, AI & LLM, Notifications, Workflows and Alerts
Reporting Reporting; when enabled, PDF reporting, Excel reporting and PowerPoint reporting
Logic Conditions, Error handling
Operators Logical, Number, Text, Date, Other operators
Procedures Procedure, when enabled
Lists and Loops List and Loop, when enabled

Search, at the top of the catalog, finds blocks by name. For the topics with their own pages, see Writeback, Embed events, PDF reports, Excel and PowerPoint reports, Alerts and AI insights from an action.

When a block gains new options, its earlier version is sometimes deprecated. Existing workbooks keep it, drawn in grey with [DEPRECATED] before its name, and it is no longer in the catalog. Replace it with the current version:

  • When the block shows a replace icon, select it (Replace with the latest version). The current version takes the old block’s place, connected to the same blocks. Set its fields again to match the old block.
  • Otherwise, drag the current version from the catalog, set it up like the old block, put it above the old block in the stack, then remove the old block.

Deprecated grey Set and Get variable blocks marked [DEPRECATED], each followed by the current Set … to and Get … value blocks.

When an action does not behave as expected, find out which blocks run and what values they see.

Action logging writes a console entry for each block that runs. It is controlled by a key in your browser’s local storage.

Chrome DevTools Application tab showing local storage for the Astrato site with the astrato_action_printing_logger key set to true.

  1. Open your browser’s developer tools (F12 in Chrome, or Cmd+Option+I on a Mac).
  2. Go to Application > Local storage and select the origin the workbook loads from: the address in the address bar or, for an embedded workbook, the address of the embedded frame.
  3. Add the key astrato_action_printing_logger with the value true.
  4. Open or reload the workbook in Preview workbook, Preview sheet or as the published workbook, so its triggers start again with logging on.

Local storage outlasts the tab and the browser session, so logging stays on until you delete the key or set it to anything other than true.

The key astrato_action_logger set to true turns on the same log with colored labels, and writes each entry’s details as an expandable object instead of a line of text. When both keys are true, astrato_action_printing_logger wins.

Open the Console tab. To cut the noise, hide entries that do not start with [AstratoAction].

Chrome DevTools Console tab filtered to an AstratoAction Start listening subscription entry for a button interaction block.

When the workbook loads, each trigger writes an entry as it starts listening:

[AstratoAction] Start listening subscription: astrato_object_event_button_interaction {"time":1782300415883,"executionId":1,"blockDetails":{"id":"Qgjx`I820xb#M9=_w#K:","type":"astrato_object_event_button_interaction","parentBlock":{}}}

A trigger with no such entry is not listening, so its action cannot run. When you trigger the action, every block that runs writes a [AstratoAction] ▶ START: entry when it begins and a [AstratoAction] ■ END: entry when it finishes, followed by the block type and these details:

Field Meaning
time When the entry was written, in milliseconds since the Unix epoch
executionId A counter that rises with each entry since the page loaded; use it to order entries
id The ID of the block that wrote the entry
type The block type
parentBlock The id and type of the block this one is attached to; blank for a trigger

To keep the log, right-click in the console and select Save as.

  1. Copy the block’s id from the entry, for example Qgjx`I820xb#M9=_w#K:.
  2. In the Actions editor, select the search icon (Search your actions, Ctrl+F or ⌘+F) and paste the ID. The search covers every workspace in the workbook.
  3. Select the result to show the block.

To find the block it is attached to, search for its parentBlock ID.

Logging shows which blocks run, not what values they work with. Add one of these blocks where you need to see a value:

  • Log writes a value to the browser console. Join a label to the value, such as my value is: followed by Get variable value, so you can tell entries apart.
  • Show toast message shows the value on screen. Set Type to Info, Success, Warning or Error, and Hide automatically to true so it closes by itself. Every viewer sees a toast, so remove debugging toasts before you share the workbook.
  • The logging key is true in local storage for the origin the workbook loads from.
  • You reloaded the workbook in a preview, published or embedded view after setting the key.
  • The console filter is not hiding [AstratoAction] entries.
  • You found the block by its id with Search your actions.
  • You deleted the key when you finished.

If the log shows the workbook doing too much at once, see Reduce the work actions do.

Each recipe names the blocks to use. After pasting copied blocks, pick your own sheets, fields, objects and variables in their dropdowns.

Select blocks and press Ctrl+C (⌘+C on a Mac), or select Copy in the toolbar; with nothing selected, Copy takes the whole workspace. To copy a workspace from the Organize: dropdown, select Copy in its menu. Then open a workspace in this or another workbook and press Ctrl+V (⌘+V) or select Paste.

Blocks copied this way are text on your clipboard, so you can also paste a block definition that someone shares with you.

Apply a default filter when the workbook opens

Section titled “Apply a default filter when the workbook opens”

Put Set filter field to values as Applied under Before workbook opens. That trigger runs before objects load, so charts query the filtered data from the start. It runs in workbook embeds too, but not when a report is produced.

Before workbook opens and Enter: Home triggers, each holding a Set filter block that sets Productname to Cable Lock, Chain and Front Brakes as Applied.

To reapply the filter every time a viewer returns to a sheet, put the same block under Enter: sheet. Set filter replaces the values already selected in that field; to add to them, use Append to filter field values values as state instead.

To keep a field filtered to exactly one value, see Keep exactly one value selected.

Filter a field from a single-select dropdown

Section titled “Filter a field from a single-select dropdown”

A dropdown bound to a variable is an alternative to Always one selected fields:

  1. Create a variable that holds the selected value, with the value to start on as its default.
  2. Add an input object, set its input type to Dropdown, and choose the variable.
  3. Create a procedure that sets the field’s filter to Get variable value, and run it from both Before workbook opens and Variable change: variable.

Procedure Select dropdown variable value that sets the Productname filter to the Selected Value variable as Applied, run before workbook opens and on Selected Value change.

The field stays at one value only while viewers cannot filter it any other way. Hide it from the filter bar with Hide fields, leave it out of filter objects, turn off filtering on the charts that use it, and turn on Hide Clear all button. See Filters.

Under Enter: Any sheet, add a Switch block and attach Get Active Sheet > Name to it. Add a case for each sheet name, with the blocks for that sheet, and use Default for the rest.

Switch block on Get Active Sheet Name with cases Self Service, Sheet 2 and Sheet 3 and a Default branch.

Keep sheet-entry actions from undoing a bookmark

Section titled “Keep sheet-entry actions from undoing a bookmark”

A bookmark that opens a sheet also triggers that sheet’s Enter: actions, which can clear or overwrite the filters the bookmark just applied. Test Bookmark-triggered Navigation, which is true when a bookmark opened the sheet. It works only under an Enter: or Exit: trigger; elsewhere it returns false.

Enter: Any sheet with an If on Bookmark-triggered Navigation that logs a message, and an Else that clears all applied and pending filters.

To use this example, copy the definition and paste it into a workspace:

{
"serializedActions": {
"type": "astrato_actions_event_enter_sheet",
"id": "1kTLWAL^Z?FsqqsuBNhW",
"x": -382,
"y": -1013,
"fields": { "sheetId": "Any sheet" },
"inputs": {
"DO": {
"block": {
"type": "controls_ifelse",
"id": "yzb?L7ifDjWIP[==~x@Y",
"inputs": {
"IF0": { "block": { "type": "bookmark_triggered_navigation", "id": "B~e@eE[PG{?n#iz7w^Ex" } },
"DO0": {
"block": {
"type": "console_log",
"id": "uGdkC;cDJdkcfzy,QFxw",
"inputs": {
"text": {
"shadow": {
"type": "custom_text",
"id": "_HRXeZpthFi(utN!gMuh",
"fields": { "TEXT": "Do nothing, if navigation triggered by bookmarks" }
}
}
}
}
},
"ELSE": {
"block": {
"type": "clear_filter_v1",
"id": "RUcG6uO0*|{blu+j:X8,",
"fields": { "clear_filter_state": "APPLIED_AND_PENDING" }
}
}
}
}
}
}
},
"workspaceId": "_48)#y#-qBus#;GdUESe"
}

Filters apply to every sheet in a workbook. To give each sheet its own, save and restore them with a private bookmark named after the sheet:

  1. Under Exit: Any sheet, add Create or update private bookmark. Build its name by joining Get Active Sheet > Id to a suffix such as |FilterState. Set Include sheet to false, and Include filters, Include state and Include variables to true.
  2. Under Enter: Any sheet, add Apply Private bookmark with the same name.

Enter: Any sheet applying a private bookmark named from the sheet ID, and Exit: Any sheet creating that bookmark from filters, state and variables, then showing a toast.

A private bookmark belongs to the viewer who created it, so each viewer keeps their own filters. See Bookmarks.

  1. Under the trigger of a button, such as Save as default view, add Create or update private bookmark and name the bookmark with Get Current User > Name > Full Name.
  2. Under Before workbook opens, add Apply Private bookmark with the same name.

A button trigger that creates a private bookmark named with the current user’s full name, and a Before workbook opens trigger that applies it.

An action under Before workbook opens or Enter: can run before a chart or table has rendered, and then fails or has no effect. Put Wait for object before the blocks that change the object, and select the objects to wait for; a container or group includes its child objects.

If an object is not ready within 120 seconds, the action stops with an error naming the objects. To wait longer, up to 600 seconds, place the blocks inside Query timeout seconds. See Give a slow query more time.

Use Set filter field from start to end as state on a date field. For the start, use add -7 Days to date(time) of Get Date & Time > Today Date; for the end, add 0 days.

Set filter block on Data Date Day from today plus -7 days to today plus 0 days, as Applied.

The range includes both ends, so -7 to 0 covers eight days. For exactly seven, use -6 to 0 to include today, or -7 to -1 for the seven full days before today, which suits data that refreshes once a day. Today Date comes from the viewer’s device clock.

Filter the previous month, quarter or year

Section titled “Filter the previous month, quarter or year”
  1. Choose a base date: Today Date, or Aggregate date field by Max for the latest date in your data, which keeps the range from being empty when data arrives late.
  2. Shift it with add -1 Months to date(time).
  3. Take get start of Month from date(time) of the result, and store it in a variable such as prev_month_start.
  4. Take get end of Month from date(time) of the same result, and store it in prev_month_end.
  5. Apply both with Set filter field from start to end.

Two add -1 Months to date(time) blocks, one on the maximum Calendar Dates Date and one on Today Date.

For a quarter or year, use Quarters or Years and Quarter or Year instead.

Before you store a date in a variable, pass it through a date block such as get start of Day from date(time), so that text such as Today Date becomes a date value.

Set Today to get start of Day from a date, with the logged value shown in the browser console.

  1. Create a String variable, and an input object with input type Dropdown bound to it, whose options are the range names, such as Last 24 Hours, Last 7 Days and Last 14 Days.
  2. Under Variable change: variable, add Switch on Get variable value, with a case for each range name.
  3. In each case, add Set filter date field from start to end. For the start, use add -24 Hours or add -7 Days to date(time) of Get Date & Time > Today Date & Time (ms); for the end, use the current time.

Variable change: FA Selected Date with a Switch whose cases Last 24 Hours, Last 7 Days and Last 14 Days each set the Alert TS filter.

Row of date buttons, Last 7 Days, Last 14 Days, Last 28 Days and Last 90 Days, with Last 14 Days highlighted.

Buttons for the ranges viewers use most save opening a date picker each time. Put the shared blocks in one procedure, here Filter last x days, with a parameter for the number of days:

  1. In the procedure, reset every button’s background with Set button container Frame Background Color.
  2. Use Switch on the parameter to give the pressed button a highlight color.
  3. Apply Set filter date field from start to end, with the start that many days before Today Date and the end one day before it.
  4. Under each button’s When button emits On click do, run the procedure with that button’s number of days.

Four button triggers that each call the Filter last x days procedure, which sets the date filter and highlights the pressed button.

  1. Create a Boolean variable, such as Is Customer. See Variables.
  2. Add an input object, set its input type to Checkbox or Toggle, and choose the variable.
  3. Under Variable change: Is Customer, add if / else with Get Is Customer value as the condition. In the if branch, add Set filter with the values to show; in the else branch, add Clear Applied and pending filters for field.

Variable change: Is Customer trigger whose if branch sets the Customerkey filter to three values as Applied and whose else branch clears it.

Show an object after a selection in a table

Section titled “Show an object after a selection in a table”
  1. Under Enter: sheet, add Set object container Visibility set to false.
  2. Under On field filter change within Pending state, for the field the table filters on, add the same block set to true. A selection in a table is pending until it is applied, so the object appears as soon as the viewer selects a row.

Enter: Demonstration hides the Bar Chart, and On Product Name filter change within Pending state shows it.

When two fields hold the same values, such as a product ID in two related tables, you can keep their filters alike. Under On field A filter change within Applied state, add Set filter field B to with the values from Fetch dimension (as list) field B type All possible.

On Track Title & ID filter change in Data Table A, Set filter on the same field in Data Table B to its list of possible values.

This copies the selection only when filtering field A narrows field B. If the tables are not related, read field A’s selected values instead.

  1. Add a table with the field to select as its dimension and the ranking measure, and give it a name you can find, such as Top Customers.
  2. In the table’s Data tab, turn on Show Top N dimension values. To let an action change N, set it from a variable such as TopN. See Show only the top or bottom N.
  3. Under Before workbook opens, add Wait for object for the table, then For each item in Get export data from Top Customers. In the loop, add Append to filter field values with the row’s first value from get value at index 1 in item.

Before workbook opens looping over the Top Customers export data and appending each Customer Name to the applied filter.

To select the values on demand, run the same blocks from a filter bar custom button. First add Clear Applied and pending filters for field, so the previous top values do not stay selected and do not narrow the table, then set TopN and wait for the table again. See Run an action from a custom button. Wait for object is more reliable than a fixed Wait seconds when queries are slow. Get export data from is in the catalog only when Excel reporting is enabled for your account.

  1. Create a translation table in your data source, with an ID column holding a variable name and one column per language.
  2. Create a String variable for each ID, and set your titles and labels from them with Text from variable.
  3. Add a filter bar custom button for each language, such as EN and FR.
  4. Under When Filter Bar emits On click do, check Custom button name, then loop over the translation table’s export data with For each. For each row, set the variable named in the ID column to the value in that language’s column.

Translation table with an ID column and En and Fr columns holding English and French text.

On Filter Bar click, for button EN or FR, a loop over TranslationTable rows that sets each vText variable from the second or third column.

Under a trigger such as Enter: sheet, add Set variable to with the AI prompt block as its value. Build its User prompt by joining your request, such as Provide a summary, to Get export data from table. Show the variable in a text object with Text from variable.

Enter: sheet setting Selected Value from an AI prompt that joins a summary request to the exported Table data.

To frame the answer for the reader, join Get Current User values, such as Name > Full Name, Role and Groups, into the System prompt, or into the Prompt additions (optional) of Generate AI insights. For both blocks, see Generate insights from an action.

Generate AI insights set to Analyse dashboard, with a prompt addition joining the user’s name, location, role and groups.

  1. Create a String variable with the SQL query sub-type. The query must return a single value. It can include another variable’s value with $(variable name).
  2. Create a second variable for the result.
  3. Under a trigger such as Before workbook opens, add Set result variable to with Execute SQL SQL variable as its value.

Before workbook opens setting a variable to Execute SQL with My SQL Variable selected.

See Variable types. To write data rather than read it, see Writeback.

Filters set by actions are not access control

Section titled “Filters set by actions are not access control”

Filters and filter locks that actions set shape what a workbook shows; they do not stop a query returning other rows, and some viewers can unlock or change them. To restrict rows by who is asking, add a security rule to the semantic layer or use your data warehouse’s access control. For locking filters, see Lock a filter.

Within that limit, actions can give each viewer a guided starting point, such as their own region:

  1. Keep a table that maps each user to their scope, such as a Users table with Email and Region columns.
  2. In a procedure, set the Users Email filter to Get Current User > Email, then set the Region filter to that user’s region.
  3. Add Lock filter for both fields so viewers cannot change them in the filter bar.
  4. For a team that should see every region, test Get Current User > Groups or Role with if / else, and use Unlock filter and clear the Region filter instead.
  5. Run the procedure from Before workbook opens.

Procedure that sets the Users Email filter to the current user’s email, sets a Region filter, then locks both filters.

To keep viewers from clearing these filters, turn on Hide Clear all button and list the fields in Hide fields in the filter bar settings, then copy the settings to other sheets with Copy Filter Bar Settings. See Filters.