Skip to content
Document Authoring DA  API Docs v1.22.2
npmGitHub

ImportSpreadsheetConfig

ImportSpreadsheetConfig:

Options for DocAuthSystem.importSpreadsheet.

Experimental: the spreadsheet API may change or be removed in any release, including minor and patch releases.

// Everything is optional; the content decides the format and the name only breaks ties
const spreadsheet = await system.importSpreadsheet(blob, { fileName: 'quarterly.xlsx' });
// Progress and cancellation together. Progress is per phase: `done` and `total` start again when it changes.
const controller = new AbortController();
const spreadsheet = await system.importSpreadsheet(file, {
abortSignal: controller.signal,
onProgress: ({ phase, done, total }) => showProgress(phase, total === null ? null : Math.min(1, done / total)),
});

readonly optional fileName: string

A hint for detection when the content is ambiguous. The content decides; the name breaks ties.


readonly optional format: SpreadsheetImportFileFormat

The format to read. The content is checked against it.


readonly optional abortSignal: AbortSignal

Aborts the import. A cancelled import rejects; it never resolves with a partly-read spreadsheet.


readonly optional onProgress: (progress) => void

Called while the spreadsheet opens, at most about ten times a second.

Not called at all for a file small enough to be read in one step, which covers most spreadsheets — so treat its absence as “still working”, not as “nothing is happening”, and show something of your own from the moment the import starts. An exception thrown from here does not fail the import.

SpreadsheetImportProgress

void