- 27 Jul 2022
- 3 Minutes to read
-
Print
-
DarkLight
Retrieving Entities with the Fetch Entities Flow Step
- Updated on 27 Jul 2022
- 3 Minutes to read
-
Print
-
DarkLight
Overview
The Fetch Entities step allows users to pull data from any entity in a Flow. The data can include Folders, built-in and custom Data Types, and Database Types. The Fetch Entities step can also define certain Fetch Criteria using query definitions and Sort options for the data retrieved.
Fetch Entities Settings
Though the below example only utilizes one of the ENTITY FETCH DEFINITION Properties, users have the option to use additional settings that provide further control over how the step fetches data.
Setting Name | Description |
---|---|
Type Name | Define which Type is being fetched by the step. |
Extension Type Name | Define which Extension Data Type is fetched by the Step, if not a default Type. |
Fetch Criteria | This window lets the user add new Fetch Criteria by using the Field Name to construct a query-like statement for Decisions to interpret automatically within the step. More than one Fetch Criteria can be configured. |
Limit Results | This Input allows users to define a specific number of fetched results. |
Sort Field | Select which Field the results will be sorted by. |
Sort Order Field | Select whether the Sort Order will be ascending or descending. |
Fetch Deleted Entities | Enabling this feature fetches Entities where the "Deleted" criteria is true. |
Fast Fetch | Enabling this feature fetches Entities quickly through indexing. |
Fetch Edit Copy of Entity | Retrieves a cached copy of the object for the Flow to manipulate. |
Read Uncommitted Data | Enabling this feature allows Decisions to read entities in a database that have been changed, but not saved. |
Example
This example will fetch data from the Account entity and populate a Data Grid on a Form with the fetched results.
- In a Designer Project, click CREATE FLOW from the Global Action Bar and select Flow. Provide a Name and click CREATE.
- Attach a Fetch Entities step from the FAVORITE STEPS category in the Toolbox panel to the Done path of the Start step.
- On the Properties panel under the ENTITY FETCH DEFINITION category, enter "account" in the Type Name field and select Account. If desired, users may define a numerical value in the Limit Results Input, to limit the number of fetched results.
- Add a Show Form step from FAVORITE STEPS in the Toolbox panel. Attach both the Results and No Results paths to the Show Form step.
- Select the Show Form step and click PICK OR CREATE FORM on the Properties panel. Select CREATE and select Form. Name the Form and click CREATE.
- From the Form Designer, configure the Form with a Data Grid (Account) component and a Button (OK) component. On the Properties panel under INPUT DATA, enter "Accounts" in Data Name. Enter "accounts" in the Type field and select Account.
- Click Save and close the Form.
- Select the Show Form step and click Unknown next to the Accounts field and select Select From Flow. Select EntityResults and click DONE.
- Connect the Done path to the End step. Click Save to save changes to the Flow.
Debug
- Click Debug on the top action bar. Click START DEBUGGING.
Fetch Edit Copy of Entity
The Fetch Edit Copy of Entity property obtains a cached copy of an object (dictated by the Fetch Entities Properties) that a Flow can manipulate. This is enabled by checking the Fetch Edit Copy of Entity box under Properties > ENTITY FETCH DEFINITION on the Fetch Entities step. The behavior of this Property can be demonstrated by applying a Change Value mapping to a Fetched Folder's Folder Name. Running the same Flow with Fetch Edit Copy of Entity enabled, will not apply this value change.
Fetch Criteria
In order to retrieve specific Entities, users may use the Fetch Criteria property. Fetch Criteria provides the ability to initiate a search Query Match based on the selected Field Name of the retrieved Entities and an optional Input Data Alias. This Alias can dictate which specific value the user wants the Fetch Entities step to search for.