Get value at index in list

Get value at index in list

  

Hi,

I have a list containing several values (Color codes).
In my action I want a specific value from the list.

Is it possible to get this value by index, instead of looping through the complete list.

Like " colorList[index] " in C#

Thanks,
Jeroen

Yes, it is possible :)
And it is done exactly like this.

Solution

Hi Jeroen,

Yes you can use a similar syntax like the example bellow to access using index:

GetCountries.List[2].Country.Name

However this is not a best practice depending on the scenario you are using it.

Hope it helps.

Ana

Solution

Hi Jeroen,


Yes you can. For example:


Best regards,

João Nobre

Hi,

Yes, it is possible to put the list record through the index.

Index - field

[0] - #FFFFF

[1] - # 000FFF

[2] - # C98CCassign 


i = 1;

MyListColors [i] .field;

Good luck.

Thanks all for helping.

Don't know why it didn't work the first time for me?

But now it works!!

curious though why you would need it in this case?

for some reason you either have colors in a dynamic table so how do you detemine which index it will be

and Colors are mostly a real candidate for a static entity and therefor you don't need the index.