Filter Collection - Split Outputs

Enoch_Foul

New Member
Hi

I would like to create a Filter Collection action that will split an input collection and provide the filtered results based on the filter criteria and then a separate collection that outputs all the records that did not match.

For Example:

Collection In:

ItemColour
BananaYellow
CarGreen
DollBlue
BellYellow

Filter Criteria: Colour = "Yellow"

Output Collection 1:

ItemColour
BananaYellow
BellYellow


Output Collection 2:

ItemColour
CarGreen
DollBlue

Any ideas how this could be done at code stage?

Thanks
 

ewilson

Member
There's a VBO called Utility - Collection Manipulation available on the Digital Exchange. That VBO has an action called Filter Collection. You'll pass in your original data and the filter criteria. It will output a new collection that matches the criteria. So, you could call it once with the specific criteria you want to match and then you could call it again with essentially the opposite of that search criteria. In other words: Colour = "Yellow" and then Colour != "Yellow".

You can find the VBO at the below link:
https://digitalexchange.blueprism.com/dx/entry/3439/solution/utility---collection-manipulation
 
Top