Optimize List Any
127
Views
1
Comments
New
Service Studio

Hi,

Right now the system action 'ListAny' does not add extra benefits since you could also use ListFilter and check whether the list is empty, or use ListIndex and check if the returned index is -1.


ListAny already returns a boolean, so why not implement it like an if-statement? With inputs List and Condition


The current situation:

In my opinion, the if-statement should not be necessary. It increases the amount of nodes and development time, and decreases readability.

My idea:



I would like to expand this idea. At the moment only one of all the built-in actions for lists is a function (ListDuplicate), but some of them have only one output parameter and can be turned into functions (unless there are limitations I'm not aware of). 

Those are ListAny, ListAll, ListFilter, and ListIndexOf. Making these actions available as functions will cover Vivianne's proposal and many other usecases.