Blue prism "The collection has no current rows"

Shivani picture Shivani · Mar 12, 2018 · Viewed 9.8k times · Source

In Blue Prism, after traversing the rows of collection using a loop, if any column is referenced to take first value of that column using CollectionName.ColmName, I am getting error saying "The collection has no current rows." although row count of collection is greater than 1. How can I set the cursor back to the first row or any other way to get first value of a column?

Answer

esqew picture esqew · Mar 12, 2018

Your misunderstanding lies in the details (emphasis mine):

Collection has no current row

After looping over a collection, you'll notice that the collection in the page will simply show the number of rows currently contained within a collection instead of the usual "Row X of Y". This state indicates that Blue Prism's internal pointer isn't looking at one row in particular.

Once you've reached the end of a collection within a loop, you could use the beginning Loop stage to reset the internal counter to 1

I'm includinig a GIF demonstration below to help illustrate my test case:

GIF demonstration