Hello All,

How to add filter a list for one column?

For example I do have color as column and I have to apply filter for selected red , blue , green check-boxes . How to achieve this?

Thanks in advance 

Prajakta Roshankhede

Hi Prajakta,


You can use Outsystems List Filter function, for reference please check below:


as per your example, you can put a color List as Source list, in condition check the selected color and it will return the filtered list


Regards,

Krushna

Hello Prajakta,


You can use the List Filter system server action.

You can use to filter your list by any condition you define.


Kind regards,

Rui Barradas

Here's an example usage of the filter action. Hope it helps.

Cheers

Nuno Miguel Verdasca wrote:

Here's an example usage of the filter action. Hope it helps.

Cheers

Here it is integer value but I have to compare it with multiple text vale. In my case red, blue and green or say if user only select red and blue then resulted records should contain red and blue values 


Hi,

if you have to compare with text values, in the condition you pass the text condition you want to compare. Can you understand what I'm saying? If you want, try it first, and if you can't, I help you ... Instead of comparing it with a string directly, you compare it with a variable that contains the string you want to compare.

Let me ask you a question... Do you want to make a filter in a list or do you want to make a filter in an aggregate?

Nuno Miguel Verdasca wrote:

Let me ask you a question... Do you want to make a filter in a list or do you want to make a filter in an aggregate?

in aggregate with multiple values on single column 


Solution

There is no way to filter an aggregate based on a text "list" of unknown size.
If the items in the text list will match exactly the content of a field, you can concatenate all the items in a single text variable, and use the following:

Index(TextListInASingleTextVariable, YourEntity.YourAttribute) <> -1

This way you will get this filter to TRUE if the value in an attribute is inside the "list" (actually, the text variable).
But it works only if you are doing exact matches. It will not work with partial matches.

Other than that you can use a SQL tool and pass the string as an input parameter (Expand Inline YES) to compose part of the query (like an IN clause).

You can also bring the results unfiltered and filter in logic with ListFilter, or one of the Forge components available to work with this kind of use cases.

And you could use a third party service, like Elastic Search or something like that.

The solution will depend on your specific needs, budget, etc.

Hope this helps.

Solution

Nuno Miguel Verdasca wrote:

There is no way to filter an aggregate based on a text "list" of unknown size.
If the items in the text list will match exactly the content of a field, you can concatenate all the items in a single text variable, and use the following:

Index(TextListInASingleTextVariable, YourEntity.YourAttribute) <> -1

This way you will get this filter to TRUE if the value in an attribute is inside the "list" (actually, the text variable).
But it works only if you are doing exact matches. It will not work with partial matches.

Other than that you can use a SQL tool and pass the string as an input parameter (Expand Inline YES) to compose part of the query (like an IN clause).

You can also bring the results unfiltered and filter in logic with ListFilter, or one of the Forge components available to work with this kind of use cases.

And you could use a third party service, like Elastic Search or something like that.

The solution will depend on your specific needs, budget, etc.

Hope this helps.

Hello Nuno,

How to concatenate the string so that I will get exact result? For example concatenate with "," or with space or just concatenate the string without another element between??


Nuno Miguel Verdasca wrote:

There is no way to filter an aggregate based on a text "list" of unknown size.
If the items in the text list will match exactly the content of a field, you can concatenate all the items in a single text variable, and use the following:

Index(TextListInASingleTextVariable, YourEntity.YourAttribute) <> -1

This way you will get this filter to TRUE if the value in an attribute is inside the "list" (actually, the text variable).
But it works only if you are doing exact matches. It will not work with partial matches.

Other than that you can use a SQL tool and pass the string as an input parameter (Expand Inline YES) to compose part of the query (like an IN clause).

You can also bring the results unfiltered and filter in logic with ListFilter, or one of the Forge components available to work with this kind of use cases.

And you could use a third party service, like Elastic Search or something like that.

The solution will depend on your specific needs, budget, etc.

Hope this helps.

Thanks Nuno, Its working for me by just concatenating string without element

Thanks again.


I'm very happy to know that I helped you find the solution. =)