Fetch a list of data records
Function: Fetch a list of data records
Get a list (paged) of data from the built-in database. Filter according to your needs, determine the amount of items & the sorting of the data. This action is perfect for displaying dynamic lists of information in your application, such as product catalogs, user lists, or transaction histories.
Input,
- Data Table:
- Description: The specific data table you want to retrieve records from.
- Type: Data Table
- Required: Yes
- Page Number:
- Description: Which page of results you want to fetch. The first page is 0.
- Type: Number
- Required: Yes
- Default: 0
- Records Per Page:
- Description: The maximum number of records to include on each page.
- Type: Number
- Required: Yes
- Default: 10
- AND Filters:
- Description: A list of conditions that all must be true for a record to be included. You can add multiple conditions, and they will be combined with an "AND" logic.
- Type: List of Filter Conditions
- Each Filter Condition requires:
- Attribute: The field in your data table to check.
- Operator: How to compare the attribute (e.g., "Equal", "Greater than", "Contains", "Is null").
- Value: The value to compare against (not needed for "Is null" or "Is not null" operators).
- OR Filters:
- Description: A list of conditions where at least one must be true for a record to be included. You can add multiple conditions, and they will be combined with an "OR" logic.
- Type: List of Filter Conditions
- Each Filter Condition requires:
- Attribute: The field in your data table to check.
- Operator: How to compare the attribute (e.g., "Equal", "Greater than", "Contains", "Is null").
- Value: The value to compare against (not needed for "Is null" or "Is not null" operators).
- Selected Attributes:
- Description: A list of specific fields you want to retrieve for each record. If left empty, all fields will be returned. This can help improve performance by only fetching necessary data.
- Type: List of Attributes
- Each Attribute requires:
- Attribute: The name of the field to include.
- Sort Order:
- Description: A list of rules to sort the retrieved records. You can define multiple sorting rules, which will be applied in the order you specify.
- Type: List of Sort Rules
- Each Sort Rule requires:
- Attribute: The field to sort by.
- Order: How to sort (Ascending or Descending).
Output,
- Found Data Page:
- Description: A variable that will hold the page of data records that match your criteria. This variable will contain a list of objects, where each object represents a record from your data table.
- Type: Page of Data
- Default:
FOUND_DATA
Execution Flow,
Real-Life Examples,
Example 1: Fetching Active Customers on the First Page
Imagine you want to display the first 5 active customer accounts in a dashboard.
- Inputs:
- Data Table:
Customers - Page Number:
0 - Records Per Page:
5 - AND Filters:
- Attribute:
Status, Operator:Equal, Value:Active
- Attribute:
- Data Table:
- Result: The variable
FOUND_DATAwill contain the first 5 customer records where theirStatusisActive.
Example 2: Finding Discounted Products in a Specific Category, Sorted by Price
You need to show all products in the "Electronics" category that are either "On Sale" or priced under $50, displaying only their name and price, sorted from cheapest to most expensive.
- Inputs:
- Data Table:
Products - Page Number:
0 - Records Per Page:
10 - AND Filters:
- Attribute:
Category, Operator:Equal, Value:Electronics
- Attribute:
- OR Filters:
- Attribute:
Status, Operator:Equal, Value:On Sale - Attribute:
Price, Operator:Less than, Value:50
- Attribute:
- Selected Attributes:
- Attribute:
ProductName - Attribute:
Price
- Attribute:
- Sort Order:
- Attribute:
Price, Order:Ascending
- Attribute:
- Data Table:
- Result: The variable
FOUND_DATAwill contain a page of product records from the 'Electronics' category that are either 'On Sale' or cost less than 50. These records will be sorted byPricefrom lowest to highest, and each record will only include theProductNameandPricefields.
Example 3: Listing Unassigned Tasks on the Second Page
You want to review tasks that haven't been assigned to anyone yet, specifically looking at the second set of 20 such tasks.
- Inputs:
- Data Table:
Tasks - Page Number:
1 - Records Per Page:
20 - AND Filters:
- Attribute:
AssignedTo, Operator:Is null
- Attribute:
- Data Table:
- Result: The variable
FOUND_DATAwill contain the second page of 20 task records where theAssignedTofield is empty or not set.