cancel
Showing results for 
Search instead for 
Did you mean: 

Collections

Anonymous
Not applicable
How can we retrieve the nth row data from collections? I have to write an expression (normally I have written collection name. column name so that I am getting the top most value) I have to get a random row value.
5 REPLIES 5

JoakimEklund
Level 6
Hi Keerthi, You could use a loop to go through the collection, set a data item as a counter, a calculation stage within the loop to increase said counter, then a decision stage to decide whether you have reached the nth row and if the row has been reached use a calculation stage to store the data of the nth row of desired column in a data item of x data type Best Regards, Joakim

John__Carter
Staff
Staff
Use a loop stage and a counter. The Read Collection Field method in the collection utility will also work.

Anonymous
Not applicable
Thank you for the information. Can you give me any other alternative without using loop.. Only in expression format.

Like John said you can use the action in the Utility - Collection Manipulation to retrieve a value from a specific row of a specific column

Anonymous
Not applicable
Another thing you could try is using the Copy Row action of the internal business object Collections. This helps you copy a range of rows (with arguments Start Row and End Row). You can mention your nth row (n-1 because the rows count as 0 to n-1) in both of these and copy it in a new collection and use it from there. This could save you using loops and counters.