Retrieve value from collection index?

sdv

New Member
Hi!
Is it possible to retrieve a value from a specific index in a collection without using some object? I want to do it in a calculation or something like that.
 

VJR

Well-Known Member
Hi sdv,

I assume you meant how to read a collection value at a particular row without using the in-built action of the Business Object.
This can be done, but is not a best practice, since it involves looping.
Here is how it is done.

Suppose you want to read the value at 8th row of a collection.
- Maintain a RowCounter data item with initial value of 0
- Start a loop stage on your collection
- Increment the RowCounter by 1
- In a Decision stage check if RowCounter = 8
If it is, then [CollectionName.FieldName] in a Calc stage will give you the desired value of that row.
If it is not, then continue with the flow of the diagram which will give you the value once it reaches row #8.
 
Top