cancel
Showing results for 
Search instead for 
Did you mean: 

#BPTechTips - Empty Collection Test

Jared.Rumball
Level 6
Hi all,

A quick and simple way to test if a collection has any rows is to use a Loop stage without hooking up the loop end. If you continue on from the loop start then there is at least one row in the collection. Otherwise if you exit out of the loop end then there are zero rows.

For example:

20656.png
Personally I often prefer this to using the collection count rows action followed by a decision stage to test the value. Not for everyone though I imagine, and be sure to annotate what you are doing as this may confuse other developers if they haven't seen this technique before!

By the way, I came across this tip in Blue Prism material ages ago but don't recall where so can't credit where I originally found out about it.

#BPTechTips


------------------------------
Jared Rumball
Q4 Associates Ltd
https://www.q4associates.biz/
------------------------------
7 REPLIES 7

Great tip out there! Definitely it will save certain number of stages while development :)

------------------------------
----------------------------------
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
Blueprism 6x 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.

This seems to be a hidden trick !! Thanks for sharing Jared.

------------------------------
MuraliKrishna
Senior Consultant - Automation Developer
------------------------------

AndrzejFidos1
Level 2
Very smart.

------------------------------
Andrzej Fidos
------------------------------

Thanks for sharing this . Never thought about this angle :)

------------------------------
Neeraj Kumar
Software Engineer
------------------------------

EmersonF
MVP
Nice, I always used count rows kk this will definitely help me a lot

------------------------------
Emerson Ferreira
Sr Business Analyst
Avanade Brasil
Recife
+5581988869544
If my answer helped you? Mark as useful!
------------------------------
Sr Cons at Avanade Brazil

Jrwork
Level 5
Top! Thank you very much for sharing this information.

------------------------------
José Francisco Bezerra Nunes Júnior
------------------------------

Great idea! It's just what I needed! Thanks!