Find Data Tables

Find Data Tables by name.

πŸ‘

Permissions Required

You must have Find permissions to a matching Data Table for it to be included in the results

Method Signature

find(): Promise<DataTablesPage>;
find(options: FindDataTablesOptions): Promise<DataTablesPage>;
find(callback: (err?: Error, dataTablesPage: DataTablesPage) => any): void;
find(options: FindDataTablesOptions, callback: (err?: Error, dataTablesPage: DataTablesPage) => any): void;

Parameters

ParameterTypeDescriptionDefault
optionsFindDataTablesOptionsOptional The paging options filter criteria to search by, or null to fetch all Users.
options.querystringOptional A query string to search by. Applies to the name property of Users
options.pageSizenumberOptional The number of Users to fetch in a single DataTablesPage response25
options.pageTokenstringOptional The nextPageToken of a previous find request, used to fetch the next set of results
callback(err?: Error, dataTablesPage: DataTablesPage) => anyOptional The callback
returnsDataTablesPageThe requested page of Data Tables

Example

/*
 * This example demonstrates finding all Data Tables and
 * logging their names
 */
const { CatalyticClient } = require('@catalytic/sdk');

const catalytic = new CatalyticClient();

const dataTables = [];

const options = { pageSize: 25 };
let hasNextPage = true;

while (hasNextPage) {
    const dataTablesPage = await catalytic.dataTables.find(options);
    dataTables.push(...dataTablesPage.dataTables);
    if (dataTablesPage.nextPageToken) {
        options.pageToken = dataTablesPage.nextPageToken;
    } else {
        hasNextPage = false;
    }
}

dataTables.forEach(table => {
    console.log(table.name);
});