Collections index?

Hi I have a Collection of 3*3

Iam using it in a loop , iam getting the current value by [collection].field. I want to check this current value with the previous ones.

eg if current value is "A" I want to check it with the Previous values or check within that particular column if this has happened some where and on basis that I have some action to do .

check current collection value with previous collections value if same some action else resume.
 

dallangoldblatt

New Member
Unfortunately, there is no way to directly reference a collection by index number in Blue Prism. I have a few suggestions that you can try:
  • Try building a new collection as you process each row, that way you can check if a value already exists in the new collection and respond accordingly.
  • Pass the collection to a custom VBO and use a code stage to do this programmatically (with indexes)
  • Since there are only 3*3=9 total cells, create a Data Item for each one, and build your logic using the individual data items
I hope this helps!
 

Sukesh Kumaru

Active Member
Hi,
In the 1st iteration collection.field1 value will be stored in a data item and in 2nd iteration compare the current value with the previous value stored in the data item and continue your logic.
 

VJR

Well-Known Member
Hi SyedShabaz03,

If you wish to know which row you are on then you can use a Counter data item and increment it using a Calc stage when the loop moves through each row.
This Counter data item is now your Row Index and then you can use the 'Read Collection Field' action after passing the Counter to the Row Index.
Note that the Row Index starts from 0 so start your Counter from 0 for the 1st row.

View attachment 1532057500339.png


"check current collection value with previous collections value if same some action else resume "
On the other hand, what do you have to do if the value is somewhere below of the current row?
Or do you say that will never happen?
 
Top