Posted 4 June 2025, 7:55 am EST
- Updated 4 June 2025, 8:00 am EST
Hi,
From what I understand, you want to detect when a Pivot Table, a normal table, or conditional formatting is added.
You can use the PivotTableAdded event, which triggers when a Pivot Table is created. Here’s a sample snippet:
spread.bind(GC.Spread.Sheets.Events.PivotTableAdded, (e, info) => {
console.log("Pivot table added:", info);
});
Although PivotTableAdded is an internal API, it can still be used for this purpose.
Alternatively, you can use the addListener API, which triggers for any operation. While this is also an internal API, it allows you to track specific designer commands. For example:
-
“Designer.createDefaultPivotTable” – when a Pivot Table is created
-
“Designer.createDefaultTable” – when a normal table is created
-
“Designer.applyRule” – when conditional formatting is applied
Here’s a sample implementation:
spread.commandManager().addListener("app", (args) => {
console.log("Command executed:", args);
if (args.command.cmd === "Designer.createDefaultPivotTable") {
console.log("Pivot Table created:", args);
} else if (args.command.cmd === "Designer.createDefaultTable") {
console.log("Table created:", args);
} else if (args.command.cmd === "Designer.applyRule") {
console.log("Conditional formatting applied:", args);
}
});
Refer to the attached GIF: 
Regards,
Priyam