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
Parameter | Type | Description | Default |
---|---|---|---|
options | FindDataTablesOptions | Optional The paging options filter criteria to search by, or null to fetch all Users. | |
options.query | string | Optional A query string to search by. Applies to the name property of Users | |
options.pageSize | number | Optional The number of Users to fetch in a single DataTablesPage response | 25 |
options.pageToken | string | Optional The nextPageToken of a previous find request, used to fetch the next set of results | |
callback | (err?: Error, dataTablesPage: DataTablesPage) => any | Optional The callback | |
returns | DataTablesPage | The 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);
});
Updated almost 3 years ago