cancel
Showing results for 
Search instead for 
Did you mean: 

A Filter for only numeric Values

ErjolaMema
Level 5

Hello everyone,

I have a collection with the field "Section" which contains these values:

010010746M
1000075365
1000282833
100062213e
etc

& I have to filter only the numbers that doeesn't have a string .(for example 1000075365,
1000282833)

I use "[Section] LIKE '[0-9]'" but it isn't working.
Could someone tell me my error?

Thank you



------------------------------
Erjola Mema
------------------------------

1 BEST ANSWER

Helpful Answers

esaugos
Level 6
Hi @Erjola Mema,

You can try executing a loop within the collection and Read the Values and further using a decision stage with logic as shown below will work i believe.
You will require another collection to add the numbered values in this way.
29071.png

------------------------------
Saurabh Goswami
RPA Architect
Ericsson
------------------------------
Saurabh Goswami

View answer in original post

4 REPLIES 4

Hi Erjola,

The reason why you are not getting proper output is because of the fact that you can't simply combine regex or regular expressions in Filter Query for collections. LIKE keyword only works with static values that you provide. In your case, you can provide a query as: [Section] LIKE '%A%' OR [Section] LIKE '%B%' and so on. Such a query wont just be long but also might be difficult to maintain. 

A better approach as per me would be to go first iterate your input collection, then use the 'Test Regex Match' action from the 'Utility - Strings' VBO where you can provide the input text string as [Input Collection.Section] and the regular expression as "[A-Za-z]+" and store the output to a flag type data item.

NOTE: Please check the name of the collection and the column and modify as per your use.


Next you can check the value of the flag data item, if the value is True then it means the current column value contains a string and you can simply skip the loop otherwise you can add a new row to another collection call 'Outputs' let say which should have the same schema as that of your Input collection using the 'Add Row' action from 'Internal-Collections' VBO and then you can simply set the value of the current column of the input collection to the same equivalent column of the output collection.

Please find the below screenshots for your reference:

Workflow Diagram:

29067.png

Test Regex Match Action Property:

29068.png

Add Row Action Property:

29069.png

Calculation Stage Expression:


29070.png

------------------------------
----------------------------------
Hope it helps you and if it resolves you query please mark it as the best answer so that others having the same problem can track the answer easily

Regards,
Devneet Mohanty
Intelligent Automation Consultant
Blue Prism Community MVP | Blue Prism 7x Certified Professional
Website: https://devneet.github.io/
Email: devneetmohanty07@gmail.com

----------------------------------
------------------------------
---------------------------------------------------------------------------------------------------------------------------------------
Hope this helps you out and if so, please mark the current thread as the 'Answer', so others can refer to the same for reference in future.
Regards,
Devneet Mohanty,
SS&C Blueprism Community MVP 2024,
Automation Architect,
Wonderbotz India Pvt. Ltd.

esaugos
Level 6
Hi @Erjola Mema,

You can try executing a loop within the collection and Read the Values and further using a decision stage with logic as shown below will work i believe.
You will require another collection to add the numbered values in this way.
29071.png

------------------------------
Saurabh Goswami
RPA Architect
Ericsson
------------------------------
Saurabh Goswami

It worked fine​.

Thank you @Devneet Mohanty



------------------------------
Erjola Mema
------------------------------

This also worked fine

Thank you @Saurabh Goswami



------------------------------
Erjola Mema
------------------------------