Collection Filter Steps
- 25 Apr 2022
- 2 Minutes to read
- Print
- DarkLight
This documentation version is deprecated, please click here for the latest version.
Collection Filter Steps
- Updated on 25 Apr 2022
- 2 Minutes to read
- Print
- DarkLight
Article summary
Did you find this summary helpful?
Thank you for your feedback
Overview
The Collection Filter or Rule Collection Filter steps allow a user to create custom Rules or Flows to filter a list. The Collection Filter utilizes a Flow with two endsteps: Include in Collection and Exclude from Collection. The Rule Collection Filter can return matches, non matches, or both. The steps can be found under the Data > Lists category.
Collection Filter step
Inputs:
Input name | Description |
---|---|
Expose Flow Data | Boolean value. Passes the Flow Data to the parent Flow |
Type | Specifies the data type which will be used by the step |
Input Collection | The inputted list for the data type |
Edit Collection Filter step | Allows the user to edit the inputs for the step |
Outputs:
Output name | Description |
---|---|
Filtered Array | Outputs the resulting list of the specified datatype |
The following example will demonstrate how the Collection Filter step can be used to filter a list of Accounts and output only Accounts whose last name starts with B.
- Create a new Flow
- Search for the Fetch Entities step and output a list of Accounts.
- Open Data > Lists and find and search for the Collection Filter step. Add the step to the workspace.
- Set the Type to String and select the list of last names as the Input Collection.
- With the step selected, choose Edit Flow.
- In the toolbox, expand Data > Texts and add the String Starts With step onto the workspace. Define the step inputs, using Entity in the Input field.
- Connect the outcome paths to the corresponding end step
- Debug the Flow to view the outputted list.
Rule Collection Filter
Inputs:
Input Name | |
---|---|
Expose Flow Data | Boolean value. Passes the Flow Data to the parent Flow |
Type | Specifies the input and outputted data type used by the step |
Data to Return | This setting determines what items will be included in the outputted list for the step, either items that evaluate as True (Return Matches), False (Return NonMatches) or outputs both as separate lists(Return Matches and NonMatches). |
Input Collection | The list of the specified datatype |
Outputs:
Output name | Description |
---|---|
Output | Outputs a filtered list of the specified datatype |
The following example will demonstrate how the Rule Collection Filter step can filter a list of food items to only show the ones that contain "Chicken".
- In the Designer Project, Create a new Flow.
- Click the Done path on the Start step. Navigate to All Steps [Catalog] > Data > List and select the Add Item to List step. Click ADD.
- On the Properties panel, change the mapping of the New Item and Original List fields by clicking Unknown and selecting Constant. In the New Item Field, enter "Chicken Alfredo". In the Original List field, enter "Shrimp Scampi", "Chicken Nuggets", "Beef Stew", and "Lasagna".
- Click the Done path and navigate to All Steps [Catalog] > Data > List. Select the Rule Collection Filter Step step and click ADD.
- On the Properties panel, map the Input Collection field to Select From Flow. Select New List and click DONE.
- On the Properties panel, click EDIT RULE.
- In the Rule Designer, click Select Data Element. Select Entity and click NEXT.The Entity is a single item from the Input Collection established within the Flow.
- From the Verb window, select Contains and click NEXT.
- In the value field, enter "Chicken" and click DONE. Click Save and close the Rule Designer.
- Connect the Done path to the End step. Click Save to save changes to the Flow.
- Click Debug from the top action bar.
- Click START DEBUGGING.
- After the debugger runs, select the Rule Collection Filter step, select Execution 1, and click View Input/Output. The Output from Rule Collection Filter Step lists the items containing the word Chicken.For further information on Flows, visit the Decisions Forum.
Was this article helpful?