1556
Views
10
Comments
Solved
How to use listfilter correctly

I only want to use the ListFilter function, but after trying to write an action, the result was not output correctly according to the conditions I wrote, and I don't know where the problem occurred.

What should I do? Can you help me?



ListFilter.oml
2023-11-14 07-36-16
Yung Shin
Solution

Sorry my bad, left out this part to change the expression to display on the local table instead.

Optional changes below:

To filter the data from database, but since you're referring to the local table, and only 1 filter is applied, this will be optional in my opinion.



Kenny

2023-11-14 07-36-16
Yung Shin
Solution

Hi Naku,

You can try the following:

P/S: Remove the Sorting Attribute on header cell



Note that your filtered data will always be based on your aggregate. If you want to fetch from the latest data from database, you should implement the filter in the aggregate instead. Hope it helps, happy coding!

Kenny

2023-11-14 07-36-16
Yung Shin

Hi, noticed that your age is in Integer type and your filter is trying to filter text type. 
If you want to filter and display on your screen, perhaps you can perform the following: 


Kenny

UserImage.jpg
Naku Sitsu

Thank you for your reply.

I want to use system action (ListFilter) in the Client Action, instead of adding filters in the DB,can you help me how shou I do?

2023-11-14 07-36-16
Yung Shin
Solution

Hi Naku,

You can try the following:

P/S: Remove the Sorting Attribute on header cell



Note that your filtered data will always be based on your aggregate. If you want to fetch from the latest data from database, you should implement the filter in the aggregate instead. Hope it helps, happy coding!

Kenny

UserImage.jpg
Naku Sitsu


I set it according to what you said, but the screen that comes out is not 21 but 18.

ListFilter.oml
2023-11-14 07-36-16
Yung Shin
Solution

Sorry my bad, left out this part to change the expression to display on the local table instead.

Optional changes below:

To filter the data from database, but since you're referring to the local table, and only 1 filter is applied, this will be optional in my opinion.



Kenny

2024-09-12 02-43-38
Deepsagar Dubey

Hello @Naku Sitsu 

I didn't opened your OML but i can refer you on the official Outsystems documetatioin for ListFilter action.

ListFilter

Returns a new list with the elements from the List parameter satisfying the given condition.

Inputs

SourceListType: mandatory, Generic Record List.

The list that contains the elements to which to apply the condition.ConditionType: mandatory, Boolean.

The boolean expression to check for on each element of the list.

Outputs

FilteredListType: Generic Record List.

A new list with the elements that satisfy the condition. 

Official Documentation

I hope it'll help you.

Thanks
Deep

UserImage.jpg
Naku Sitsu

Thank you for your reply.

I wrote it this way, but I'm not sure if there was something wrong with the settings inside that caused the function to not be implemented in the end. Can you teach me?


2024-09-12 02-43-38
Deepsagar Dubey

It's simple enough

Just paas your list which you want to filter set a condition and use listfilter output list,

This will be the filtered list.

2025-03-19 01-45-51
Sandeep Kumar Kolli

@Naku Sitsu you should assign the out list which is coming from your list filter action.

2019-06-03 19-36-49
Pedro Santos

Hi All 🙂


I have created a tutorial video explaining how List Filters works, with normal filter and also with Index function. Make sure to watch it.

https://youtu.be/M9ce_luUUWQ

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