Download a Data Table

Download a Data Table as a CSV or Excel (xlsx) file.

šŸ‘

Permissions Required

You must have permissions to read the Data Table for this request to succeed.

Method Signature

download(id: string, format: DataTableExportFormat, path: string): Promise<void>;
download(id: string, format: DataTableExportFormat, path: string, callback: (err?: Error) => any): void;

Parameters

ParameterTypeDescription
idstringThe id of the Data Table to download
formatstringCSV or XLSX (Excel)
filePathstringThe path on disk to save the download to.
callback(err?: Error) => anyOptional The callback

Example

/*
 * This example demonstrates downloading a Data Table
*/
const { CatalyticClient } = require('@catalytic/sdk');

const catalytic = new CatalyticClient();

const id = 'c9f2beec-10c0-4f2f-b4e0-1d884c7e053c';
const downloadPath = '/path/to/download/location/for/file';
await catalytic.dataTables.download(id, 'CSV', downloadPath);

console.log(`DataTable downloaded to "${downloadPath}"`);