cancel
Showing results for 
Search instead for 
Did you mean: 

#BPTechTips - Empty Collection Test

JaredRumball
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/
------------------------------
6 REPLIES 6

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 it helps you out and if my solution resolves your query, then please provide a big thumbs up so that the others members in the community having similar problem statement can track the answer easily in future.

Regards,
Devneet Mohanty
Intelligent Process Automation Consultant | Technical Business Analyst,
WonderBotz India Pvt. Ltd.
Blue Prism Community MVP | Blue Prism 7x Certified Professional
Website: https://devneet.github.io/
Email: devneetmohanty07@gmail.com

----------------------------------

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

Top! Thank you very much for sharing this information.

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