Hello all,
I have a list of structure.
This list contains, for example 20 elements, but I want to filter it in order to get the last 6 elements. How can I do this?
Thank you all š
Hey Catarina,
You could use the ListFilter from (system) and write logic using the CurrentRowNumber and the length/count of the list, i.e. you want the records where the CurrentRowNumber >= (Length - 6), or something along these lines
I hope this helps :)
Hi Catarina Gomes,
Create a new local variable of same type where you want to keep last 6 element.
1st Solution-
Use ListAppendAll system action- and append value index wise.
for example- For last 2 element use Employee[length-1]
2nd last Employee[lenght-2] and so on.
In below screen shot- Last2Employee is local var (Employee List type) and I am appending last 2 element of Employee list.
It is simple and easy solution when you want to take few element of list.
2nd solution- Use for each loop and iterate form length -6 element for last 6 element.
Hope this help.
Thanks and regards,
Rahul kr.
Hey Catarina Gomes ,
For example stutents is list
for each stutents[ stutents length-i ] and increase i=i+1 upto i<=5.
thanks,
Ramesh