cancel
Showing results for 
Search instead for 
Did you mean: 

Utility Collection Manipulation Filter Data Syntax

NaveenR2
Level 2
List Items:

123
B45
789
123
A45
456
 I'm having above list items in a collection. Now i have to filter the only numeric values from collection. Can you guys tell me the syntax for utility collection Manipulation Filter data


------------------------------
Naveen R
------------------------------
3 REPLIES 3

Hi Naveen,

In the expression editor, check out the logic function IsNumber. Using that with a loop should allow you to accomplish this task.

------------------------------
Patrick Aucoin
Senior Product Consultant
Blue Prism
------------------------------

loganathans
Level 3
Add input and output
'Will be populated with each cell of column
Dim columnList As List(Of String)
'Setting regex filter
Dim filter As New Regex(regexFilter)

Dim matchList As New List(Of String)

'Every cell in column to list
columnList = (From r In CollectionIn.AsEnumerable() Select r.Field(Of String)(columnName)).ToList()

'Go through each cell
For Each cell As String In columnList
	'Add every match to list
	For Each regexMatch as Match in filter.Matches(cell)
	matchList.Add(regexMatch.Value)
	Next
Next
matchList = matchList.GroupBy(Function(x) x).Select(Function(x) x.First).ToList()

CollectionOut = New DataTable
CollectionOut.Columns.Add("Values", GetType(String))
For Each match As String in MatchList
CollectionOut.Rows.Add(match)
Next


------------------------------
loganathan s
IT Developer
DXC
Asia/Kolkata
------------------------------

John__Carter
Staff
Staff
There is some useful information on syntax here Naveen. Once inside a code stage, a BP collection is represented as a .Net datagrid.

https://www.csharp-examples.net/dataview-rowfilter/

------------------------------
John Carter
Professional Services
Blue Prism
------------------------------