Spreadsheet Editor events enable your application to respond to changes and user interactions within the Spreadsheet Editor.
Events are exposed through the SpreadsheetEditorManager class and can be used to detect editor initialization, edit mode changes, sheet updates, cell modifications, selection changes, and formula bar actions. Subscribe to these events to implement custom workflows, synchronize application state, validate data, and extend the editor experience.
Editor events
Editor events provide notifications about the overall Spreadsheet Editor lifecycle and state. For example, these events occur when the editor is initialized and when the editing mode changes.
Initialize the editor
The spreadsheetEditorReady event fires when the editor has finished initializing and is ready for use. Use this when you want to perform editor operations immediately on load.
Sheet events are triggered when users interact with worksheets or when sheet-level changes occur, such as switching between sheets or modifying worksheet content.
Detect active sheet updates
The activeSheetChanged event fires when the editor has switched to a different sheet.
The sheetChanged event fires when a sheet's state changes, such as renaming, deletion, creation, or visibility. The available options are listed in the SpreadsheetChangedActionsdefinition.
Cell events notify your application when cell data or selections change. Use these events to react to data updates, refresh dependent UI elements, or implement validation logic.
Track cell and range updates
The dataChanged event fires when a cell or cell range is modified. Changes can include values, styles, cut or paste, merge or unmerge, and add or remove rows and columns. The DataChangeTypetype shows all available options.
The selectionChanged event fires when the editor selects a different cell. The editor will fire an event on initialization to indicate it has selected the top-left cell.
Formula bar events notify your application when users interact with the formula bar. Use these events to monitor formula input, surface formula information, and provide search suggestions as users build formulas.
Track formula bar inputs
The formulaBarTextChangedEvent event fires when the formula bar text input changes. The following code shows how to listen to the text changed event and log each segment of the formula bar using the getInfo() function.
The formulaHelpEvent event fires when the selection of a formula is confirmed, like =SUM(, and returns the formula name, description, and parameter information. The following code sample shows how to listen to the help event and log the available formula information using the getFormulaInfo() function.
The formulaSearchEvent event fires when a user types in the formula bar before confirming a formula. The editor returns a list of formulas that closely match the search query. It must start with an equals sign (=) to trigger the search. The following code sample shows how to listen for the search event and log the results as an array.