Hello everyone,
I’m working in OutSystems Developer Cloud (ODC) and looking for a simple way to check if a specific value (e.g., Entities.Role.Requestor) exists in a list (UserRolesOfficeList) directly within an If condition, similar to LINQ’s Any() in C# (e.g., UserRolesOfficeList.Any(role => role.RoleId == Entities.Role.Requestor)).
Does anyone know of an ODC-compatible Forge component that provides this functionality? Or is there a built-in way in ODC to achieve this without a separate ListFilter? I’d appreciate any recommendations or examples!
Thanks!
Hi @uriel oved
In OutSystems, the ListAny action, available in the OutSystems Developer Cloud (ODC) and in OutSystems 11, determines if any element within a list satisfies a specified condition. It returns True if at least one element in the list meets the condition, and False otherwise.
Where to find it:
ODC Studio: You'll find the ListAny action under System Actions in the Logic tab, both under Client Actions and Server Actions.OutSystems 11: You can locate it under System Actions in the Logic tab.
I hope it'll help you.
ThanksDeep
Hi Deep,
Thank you for your response and for pointing out the ListAny action in ODC! However, I was specifically asking about a solution that mimics the LINQ Any() functionality from C#, where I can directly use a condition like UserRolesOfficeList.Any(role => role.RoleId == Entities.Role.Requestor) within an If condition in a flow, without needing a separate action or variable.
From your answer, it seems ListAny is available under System Actions in ODC, but could you clarify if it can be used directly in an If condition expression, similar to LINQ’s Any()? If not, is there a Forge component or another built-in ODC feature that provides this kind of concise, LINQ-like syntax for checking if any element in a list
Thanks again for your help!
Best regards,
Uriel
Hi Uriel,
No, we can't use ListAny action directly in If condition instead we can use ListAny action output param of Boolean type.
Thanks for clarifying that ListAny cannot be used directly in If conditions. Appreciate your help!