Select Class


Methods of the Record class

Guides

Welcome to class reference

Class: Record
NameTypeComment
RecordClassThis class is to help the user interact with Records.

Note: Remember to add Roles to Groups
and add Groups to Users that will be a part of the workflow.

Method: getAll
NameTypeComment
getAllMethodGet Records from a Table.
ReturnRequirements
A table of Records.none

Parameters
NameCommentType
tableApiNameThe Table api name.string
paramsQuery params.
                            


{ filters: FilterGroupInterface; search: string; page: number; limit: number; sort: string; }




Examples

Example case:
Get records

Description:
Get records without any parameters.

// Variables const tableApiName = "business_mate_task_list"; // Run the method and store the results in a variable const result = await Record.getAll(tableApiName); // Test print the result console.log(result);

Example case:
Get records with search

Description:
This method can be used to get all records from a table, using a 'search' word. In the example we are searching for records which have a 'priority' of '2'.

// Variables const tableApiName = "business_mate_task_list"; const data = { search: '2', }; // Run the method and store the results in a variable const result = await Record.getAll(tableApiName, data); for (const element of result.items) { // Test print the result console.log(element); }

Example case:
Get records with a limit

Description:
This method will get records from a table and limit 5 displayed per page.

// Variables const tableApiName = "business_mate_task_list"; const data = { limit: 5, }; // Run the method and store the results in a variable const result = await Record.getAll(tableApiName, data); for (const element of result.items) { // Test the result console.log(element); }

Example case:
Get all with a filter

Description:
This method uses a filter to get all records of a table that have a 'priority' of value '2'.

// Variables const tableApiName = "business_mate_task_list"; const data = { filters: { type: 'FILTER_GROUP', logicalOp: 'AND', filters: [ { type: 'FILTER', fieldApiName: 'f_priority', comparator: 'is', value: "2", }, ], } }; //Run the methods and store the results in a variable const result = await Record.getAll(tableApiName, data); for (const element of result.items) { // Test print the result console.log(element); }