How is your experience with the OutSystems Community?
4910
Views
14
Comments
How to select specific record from list variable?

For any particular list variable, I have found the below properties like

1. Current
2. EOF

3. BOF

4. CurrentRowNumber

5. Length

6. Empty


But how can I find  record for any specific id?

like I need to find list record for id = 5 

Is there any build-in-function?


Anyone Please give me an example 

2024-06-19 07-19-32
JitendraYadav

Manish Kumawat wrote:

For any particular list variable, I have found the below properties like

1. Current
2. EOF

3. BOF

4. CurrentRowNumber

5. Length

6. Empty


But how can I find  record for any specific id?

like I need to find list record for id = 5 

Is there any build-in-function?


Anyone Please give me an example 


Hi,


Please check the List filter function.

https://success.outsystems.com/Documentation/10/Reference/OutSystems_APIs/System_Actions#ListFilter


Thanks

2025-11-19 06-14-01
Miguel Verdasca
Champion

What Id are you talking about? The record Id? Or the record's 5th position? Your question is a little confused. You can explain your question better.

2020-01-07 12-37-37
Manish Kumawat

Migalhas wrote:

What Id are you talking about? The record Id? Or the record's 5th position? Your question is a little confused. You can explain your question better.

Its not for 5th position.
Is it for that record which Id is equal to 5


2024-06-19 07-19-32
JitendraYadav

Manish Kumawat wrote:

Migalhas wrote:

What Id are you talking about? The record Id? Or the record's 5th position? Your question is a little confused. You can explain your question better.

Its not for 5th position.
Is it for that record which Id is equal to 5



that's ok just use list filter and use condition.

2023-02-01 09-55-42
Otávio Souza
Staff

Hi Manish, 

I don't believe there's a built-in function for that. 

But it seems as easy as run your list and check if the id = 5 than assign the record to a variable you have previously defined. 


Does it reply your question?


Thanks,

2025-11-19 06-14-01
Miguel Verdasca
Champion

Do you want this kind of Id:

or


Use a similar syntax like the example bellow to access using index:

GetListName.List[5].ListName.Atributte

However, depending on the scenario you are using it, it's not a best practice 


2024-06-19 07-19-32
JitendraYadav

Manish Kumawat wrote:

For any particular list variable, I have found the below properties like

1. Current
2. EOF

3. BOF

4. CurrentRowNumber

5. Length

6. Empty


But how can I find  record for any specific id?

like I need to find list record for id = 5 

Is there any build-in-function?


Anyone Please give me an example 


Hi,


You can also check the index like .net/java way

like List[5].Text

2018-06-05 16-54-03
Maria da Graça Peixoto

HI!

YourVariable[4].yourfield

This will return the value from field "yourfield" from the fifth element from YourVariable list. 

Hope this help

Graça

2024-06-19 07-19-32
JitendraYadav


Assign Source List and then appropriate condition as per ur requirement...Thanks

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Manish,

To sum up the answers above:

  1. If you are looking for a record with a specific value, use ListFilter, and set the right condition (e.g. "Id = 5");
  2. If you are looking for a record with a specific index, use List[index].

That's it. If any of the answers above were the solution for you, please mark it as such, thanks.

2020-01-07 12-37-37
Manish Kumawat

Kilian Hekhuis wrote:

Hi Manish,

To sum up the answers above:

  1. If you are looking for a record with a specific value, use ListFilter, and set the right condition (e.g. "Id = 5");
  2. If you are looking for a record with a specific index, use List[index].

That's it. If any of the answers above were the solution for you, please mark it as such, thanks.


Hi Kilian,


First is not working. Like when follow and used like below 

ListIndexOf(UserList, Name = "James")

It gives me error

like

Can't Identify 'Name' element in expression.



But the second one is working fine.


Thanks & Regards

Manish Kumawat



UserImage.jpg
OneAndy

Hi Manish!  Since ListIndexOf basically iterates through all the items in the list until it finds the matching attribute, you have to tell it to find that attribute in the Current item like so:
 

ListIndexOf(UserList, Current.Name = "James")


Then, if you want to get the actual item with that value, you might do something like:

List[ListIndexOf(UserList, Current.Name="James")]

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Manish,

ListIndexOf is not a Function, you can't use it like that. Instead, use it like this:

UserImage.jpg
yasir khan

Example how to use List Index on update

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.