Hello,
Goal:
I want to iterate through a string to determine if it contains a substring that is part of a pre-defined list.
Behaviour:
When using IndexOf to determine if the substring is of index > -1, the check does not return the expected results.
Steps:
-
Main input contains a number and a description.
-
I have a reference list which I want to compare to the main description to determine if contains any of these searchterms.
-
I count the number of searches and put all terms in a group.
-
Create an array of the searchterms and check each [i] against the main description (represented by var SelectedColumn) and if found, exit the search.
Note: since this will be a component, there are some configuration steps to set the column the search should be applied to.
Issue: the index always return -1, expecting that either the variable or the array element is not coming through properly. In this case, it should be larger than -1 because the string "Handle Ashtray
" contains “Ashtray”.
Any insights or corrections would be much appreciated
Workflow attached.
iterate_indexof.knwf (26.8 KB)