cancel
Showing results for 
Search instead for 
Did you mean: 

Facing a weird issue with collection in 7.3.1

Hi team,

I'm facing a weird issue when extracting a field value from a collection using simple dot notation.

See the snaps below. The collection has data and values, but in the calc stage, all the fields are showing empty values. If I run then it also throws error.

To note this is outside the loop. Post loop completion I'm using a calc stage to grab a value. If I perform the same before the loop, calc stage works fine.

Tejaskumar_Darji_1-1728056824578.png

In Collection I can see value

Tejaskumar_Darji_2-1728056861896.png

 

Tejaskumar_Darji_0-1728056722531.png

Tejaskumar_Darji_3-1728057000704.png

 

 

3 REPLIES 3

david.l.morris
Level 15

Hi @Tejaskumar_Darji,

Anytime a collection says "# Row" or "# Rows", you can't use an expression to reference a field in it because no row is selected. The reason it works before the loop is that by default Row 1 is selected. If you only have one row, then it can lead you to think something is wrong here when you try to use a calc after the loop, but it's always functioned like this I think. I tested it in 7.3.1 and 6.10.1 just to make sure I'm not crazy, and I see the same behavior in both. I get an error in the calc stage after the loop saying the collection has no current row.

As for the other issue you mentioned where the calc stage appears to be empty, did you try setting the value into a data item? I am guessing it shows empty for you where it says Temporary Values because that's just what it does if you don't have a current row selected, such as once you leave the loop. I tested this in 7.3.1, and during the loop for me it gets the value.

davidlmorris_0-1728066917663.png

 


Dave Morris, 3Ci at Southern Company

Yes, the collection and field I'm referring to have data. I understand the # row notation but once loop is completed shouldn't it return to the default behaviour as it was before the loop?

I have a master collection from that I'm taking a coll field to a local collection, now if I copy the same collection to 2 different collections and loop only on one of them still it shows # Row in all collections.

Try to take another parent collection and then save your Data collection on this page. Now take Data1, Data2, Data3 and populate it using 3 calc stages. After that run loop on Data1 and notice the # Row label on all Data2 and Data3.

Post loop completion all 3 will go into the same issue even though all 3 are individual collection.

Hi @teja1 ,

As @david.l.morris  rightly said this is an issue (if it's an issue) since always in Blue Prism (faced in v6.3, v6.6, v7.1)

You can always fetch the 1st row value using a calculation stage at the beginning of a loop as the collection notation shows Row # of #

swapnadeep_deb_0-1728312119503.png

swapnadeep_deb_1-1728312192385.png

Once you end the loop and the collection notation changes to # rows , if you try fetch the value it throw the same error.

swapnadeep_deb_4-1728312783418.png

 

The fix I found because of the similar issue as yours is to use the Remove empty rows action as a 1st thing at the end of the loop. This resets the collection notation back to Row # of # and you can continue with your thing.

swapnadeep_deb_3-1728312643756.png

I guess BP needs to come up with a Reset Collection Status action !

 

 

 

 

Swapnadeep Deb
RPA Developer
TCS