64
Views
7
Comments
Logic Behind inbuilt function 'List Filter'

Hello Team,

Is there any documentation available which describe the logic behind the 'List Filter' inbuilt action used in Outsystems. 


Regards

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

Hi Sushant,

What do you mean in this context with "logic"? Do you want the actual code, or the explenation, or what?

2023-09-15 13-34-43
Sushant Sharma

Hello Kilian, 

I want the actual code and explanation. 

Thanks

 

2023-01-26 16-03-24
Ana Agostinho

Hello Sushant Sharma, 

Please check the following documentation link for more information: 

Best regards,

Ana

2023-09-15 13-34-43
Sushant Sharma

Hello Ana.

Thanks for the support, But i am looking for in-depth code explanation for 'List Filter'

Regards

2023-01-26 16-03-24
Ana Agostinho

Hello again, 

That built-in acton belongs to the Systems module. I believe that, unfortunately, you don't have access to the logic/implementation of that module. 

Best regards, 

Ana

2017-06-21 13-04-28
Mikko Nieminen

Hello,

OutSystems ListFilter is a built-in action and as it's part of platform code, I don't really think explanation or source code is something we'd get or even need. If it works, it works?

Best guesses can however be made. So - no explanation, but some guesswork based on underlying technologies and provided interfaces. In short, functionality inside can be described like this:

  1. provide a list
  2. provide condition which will evaluate to boolean
  3. iterate through input list
  4. for each entry, check if condition evaluates to true
  5. if true, add to output list
  6. move to next entry, loop until done
  7. return output list

Input & output list parameters are "Generic Record List" type, which in OutSystems, isn't available on anywhere else than system provided functions (OutSystems being strongly typed language). This however gives some ideas how platform might be implementing this functionality, given that we know O11 is generating C# (or, JavaScript code).

Microsoft .NET documentation provides some ideas what generics are (https://learn.microsoft.com/en-us/dotnet/standard/generics/) and how generic lists can be manipulated: https://learn.microsoft.com/en-us/dotnet/standard/generics/delegates-for-manipulating-arrays-and-lists

From search engines, first hits to StackOverflow questions we can find this question where implementing this kind of functionality is discussed: https://stackoverflow.com/questions/56042603/how-to-filter-the-list-based-on-generic-property

From those answers, at least reflection based approach would work, although it would need to be expanded to accept multiple simultaneous conditions.

Somebody more proficient in JavaScript could probably provide an explanation on that side, but generally the idea and implementation is the same. This is also discussed in the depths of Stack Overflow: https://stackoverflow.com/questions/63159291/javascript-generic-search-of-array-of-objects

br,
-Mikko(N)

2023-04-13 07-10-08
Geertjan Jacobs

@Sushant Sharma What is the reason behind this request? Maybe we can answer any questions or unclarities without knowing the actual code.

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