For any particular list variable, I have found the below properties like
1. Current2. 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
Manish Kumawat wrote:
Hi,
Please check the List filter function.
https://success.outsystems.com/Documentation/10/Reference/OutSystems_APIs/System_Actions#ListFilter
Thanks
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.
Migalhas wrote:
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.
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,
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
You can also check the index like .net/java way
like List[5].Text
HI!
YourVariable[4].yourfield
This will return the value from field "yourfield" from the fifth element from YourVariable list.
Hope this help
Graça
Assign Source List and then appropriate condition as per ur requirement...Thanks
To sum up the answers above:
That's it. If any of the answers above were the solution for you, please mark it as such, thanks.
Kilian Hekhuis wrote:
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
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")]
ListIndexOf is not a Function, you can't use it like that. Instead, use it like this:
Example how to use List Index on update