Hi everyone,
I’m working on a logic in OutSystems where I have:
1. List of Texts "WordList"
2. Text input "InputText"
I want to check if any word from the list exists in the input text. What’s the best way to implement this in OutSystems with the best performance?
Hi Lukasz,
You can use the ListAny action, which is available under System Actions.
This action will determine if any of the elements in the list satisfies the given condition.
Ex: WordList.Text = InputText
For more details, check the documentation here: Documentation
To efficiently check if any word from the WordList exists in the InputText, you can leverage the ListAny system action within OutSystems. This provides a concise and performant way to handle such conditions. Here's the approach:
WordList
InputText
ListAny
System Action: ListAny Use ListAny to iterate through your WordList and define a condition that checks if the InputText contains any word from the list.
Implementation Details:
Condition
Index(InputText, CurrentWord) <> -1
CurrentWord
Explanation:
Index
-1
Steps in OutSystems:
List
For cases with large WordList, you may also consider pre-processing or optimizing the list to avoid repetitive searches, depending on system constraints.
This method ensures effective performance while achieving your logic goals! For additional insights on similar use cases, refer to Find the given Text exists in the List of Text.