{ filters: FilterGroupInterface; search: string; page: number; limit: number; sort: string; }
Name | Type | Comment |
---|---|---|
Record | Class | This 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. |
Name | Type | Comment |
---|---|---|
getAll | Method | Get Records from a Table. |
Return | Requirements |
---|---|
A table of Records. | none |
Name | Comment | Type |
---|---|---|
tableApiName | The Table api name. | string |
params | Query params. |
|
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); }
Start your 3 months of free trial now. Sign up and start your business flow right away
Get your business mate now