Rule Collection Filter Step

Last Updated: 03/27/2018 Introduced in Version: 3.2

This tutorial demonstrates how to use Rule Collection Filter Step. This step designer is able to create a custom Rule to filter collection of any type in Decisions.

Example

In this example we are going to use a Rule Collection Filter Step to filter a list of Accounts in Decisions.

We begin in the Designer Folder with selecting the FLOW button.

 

In the resulting window,  name the Flow and click CREATE to proceed to the Flow Designer.

 

In the Flow Designer we add a Get All step from Integrations > All Integrations > Internal Services > Account Service.

 

Then we add and connect a Rule Collection Filter Step, from All Steps [Catalog] > Data > List, to the Get All step in our Flow.

 

Next, we are going to set up a Rule Collection Filter Step. In the Inputs section of the Step settings we can check Expose Flow Data check-box if we would like to be able to use all Flow Data in our Filter Rule. Then, with the Type picker we are going to use the All/Search category to select a type of the List that we are going to Filter with our custom Rule. In this case, it will be the Account type.

 

In the Input Collection setting we are going to Select Value of the Get All Output in our Flow.

 

Then, with our Rule Collection Filter Step selected, we click Edit Rule to create our custom Rule Filter.

 

First, we expand Entity, select Email Address and click Next. Entity is our single Account from the Input list. This custom Rule will be evaluated against each Entity in the list and filter out all entities if the Rule outputs False.

 

In the resulting window we pick Contains verb and click Next.

 

Finally, as value for this condition we define Constant ‘admin’. Click Done when finished.

 

Our Rule reads Entity.EmailAddress Contains admin, therefore the output from this step will be a list of Accounts which email addresses contain ‘admin’. We can save and close Rule Designer.

 

Back in the Flow Designer we connect Rule Collection Filter Step outcome to the End Step in our Flow. With End Step selected on the workspace we click Show Editor under Data.

 

In the resulting Data Definitions window we specify a data member of type String called AllEmailAddress. We then check Is List and Can Be Null. We can close this window.

Then, back on the Edit Step window, a new section called Inputs has appeared with All Email Address in it. We specify the Mapping Type as Select Value, and then click Pick. This will open up a Pick Data… window. Expand Rule Collection Filter Step Output and then select EmailAddress. Click Pick.

When finished Adding Data we close the Edit Step window.

 

This completes our Flow. We can click Debug Flow on the top panel of the Flow Designer.

 

Our Flow executes in the Debugger with no issues. If we check Rule Collection Filter Step Input Data we can see a list of all Accounts in Decisions.

The Output from Rule Collection Filter Step is a list of filtered Accounts which email addresses contain ‘admin’.

Finally, our End Step outputs a list of Email Addresses from the Filtered List of Accounts.

 

Additional Resources