cancel
Showing results for 
Search instead for 
Did you mean: 

Filter Collection based on Regex Pattern

Anonymous
Not applicable
Hi guys,

Can you please provide a hint how I can filter a collection based on regex Pattern?

Would like to filter the columnName based on regex.

Any hints are appreciated!

Thank you!

------------------------------
Cohen
RPA Developer

Romania
------------------------------
5 REPLIES 5

VivekGoel
Level 10
https://datatables.net/examples/api/regex.html

https://datatables.net/reference/option/search.regex

Check the links for ideas.

------------------------------
Vivek Goel
RPA Architect
Asia/Singapore
https://www.rpatools.com/
"If you like this post, please press the "Recommend" Button.
------------------------------

Anonymous
Not applicable
lol! they are js. i have the C# code is running smoothly on Visual Studio, but in BP is not running.... this is odd.

------------------------------
Cohen
RPA Developer

Romania
------------------------------

It waa for idea 🙂

However, if you can share the C# code which works in Visual Studio , i can give a shot to make it an object which u can use.



Sent from my Samsung Galaxy smartphone.


------Original Message------

lol! they are js. i have the C# code is running smoothly on Visual Studio, but in BP is not running.... this is odd.

------------------------------
Cohen
RPA Developer

Romania
------------------------------

Anonymous
Not applicable
Hi Vivek,

The C# code can be found here on this discussion.
The original one.
https://social.msdn.microsoft.com/Forums/en-US/0e2a357d-9281-47e8-ad1a-f6dbea24d92b/filtering-a-datatable-using-regularexpression?forum=regexp

My code is tweaked based on this MSDN code.

The object has in start inputs: myCollection as Collection that has to be filtered, myColumn as Text which is the Column Name that has to be filtered and the ReGex pattern as Text that contains the regex that has to be used for filtering the myColumn of myCollection. The same inputs are to be found into the Code Stage.

Output from Code stage is table as Collection , the table that is filtered based on regex. The same output is in the end also.

Thank you in advance.
------------------------------
Cohen
RPA Developer

Romania
------------------------------

Hi there, 
On filtered collection try to use DataTable.Copy()
and assign it to the output Collection variable in the BluePrism.

Hope that will work for you.


------------------------------
Kind regards,

Dmitrij Mamajev
RPA Developer
Volvo Cars
Gothenburg - Sweden
------------------------------
Kind regards, [FirstName] [LastName] [Designation] [JobTitle] [CompanyName] [City] [State] [Phone]