New to Kendo UI for AngularStart a free 30-day trial

Angular Spreadsheet JSON Import and Export

Updated on Mar 26, 2026

The Spreadsheet can serialize its entire workbook state, including cell values, formatting, formulas, and sheet configuration, to a plain JavaScript object and restore it at any time. This makes the JSON API ideal for scenarios like auto-saving drafts or persisting state to a database.

Importing JSON Data

To programmatically load a workbook from a JavaScript object, use the fromJSON method of SpreadsheetWidget. The object must conform to the DocumentDescriptor type, which describes the full workbook structure including sheets, rows, cells, and their properties.

ts
public loadJSON(spreadsheet: SpreadsheetComponent): void {
    spreadsheet.spreadsheetWidget.fromJSON({ sheets: data });
}

The following example demonstrates the fromJSON method in action.

Change Theme
Theme
Loading ...

Exporting to JSON

To serialize the current workbook state, use either the saveJSON or toJSON method of SpreadsheetWidget. Both methods return a JavaScript object that captures all sheets, cell values, formatting, and formulas.

The key difference is that saveJSON returns a Promise, which makes it the correct choice when the workbook contains embedded images that require asynchronous processing. Use toJSON for synchronous serialization when no images are present.

ts
public onSave(spreadsheet: SpreadsheetComponent): void {
    spreadsheet.spreadsheetWidget.saveJSON().then((data) => {
        this.jsonData = data;
    });
}

The following example demonstrates the saveJSON method in action.

Change Theme
Theme
Loading ...
In this article
Importing JSON DataExporting to JSONSuggested Links
Not finding the help you need?
Contact Support