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

FileInfo Download(Guid id, DataTableExportFormat format, DirectoryInfo directory = null);
async Task<FileInfo> DownloadAsync(Guid id, DataTableExportFormat format, DirectoryInfo directory = null);

Parameters

ParameterTypeDescription
idGuidThe id of the Data Table to download
formatDataTableExportFormatCSV or Xlsx (Excel)
directoryDirectoryInfoOptional The directory to save the download to. The file's
original name will be preserved. Defaults to a local temporary directory.
returnsFileInfoA reference to the downloaded file
FileInfo Download(string id, DataTableExportFormat format, DirectoryInfo directory = null);
async Task<FileInfo> DownloadAsync(string id, DataTableExportFormat format, DirectoryInfo directory = null);
ParameterTypeDescription
idstringThe id of the Data Table to download
formatDataTableExportFormatCSV or Xlsx (Excel)
directoryDirectoryInfoOptional The directory to save the download to. The
Data Table's name will be preserved used as the file name. Defaults
to a local temporary directory.
returnsFileInfoA reference to the downloaded file
FileInfo Download(Guid id, DataTableExportFormat format, FileInfo file);
async Task<FileInfo> DownloadAsync(Guid id, DataTableExportFormat format, FileInfo file);
ParameterTypeDescription
idGuidThe id of the Data Table to download
formatDataTableExportFormatCSV or Excel (xlsx)
fileFileInfoThe file name and path to save the download to.
returnsFileInfoA reference to the downloaded file
FileInfo Download(string id, DataTableExportFormat format, FileInfo file);
async Task<FileInfo> DownloadAsync(string id, DataTableExportFormat format, FileInfo file);
ParameterTypeDescription
idstringThe id of the Data Table to get a readable stream of
formatDataTableExportFormatCSV or Excel (xlsx)
fileFileInfoThe file name and path to save the download to.
returnsFileInfoA reference to the downloaded file

Example

/*
 * This example demonstrates downloading a Data Table
 */
using Catalytic.Sdk.Entities;

namespace Catalytic.Sdk.Examples
{
    class Program
    {
        static void Main(string[] args)
        {
            var catalytic = new Catalytic.Sdk.CatalyticClient(Credentials.Default);
            var file = catalytic.DataTables.Download("8d20bdf5-d3bb-4a08-b05b-eb22a8b5c300");
            Console.WriteLine($"DataTable downloaded to {file.FullName}");
        }
    }
}