Hello guys,We're dealing it some issue on attempting this:Right now with find() function or exact() you can't achieve the following:Let's say we have an e-mail with this phrase "I am an idealist", and on the other hand we have a key defined as: "ideal", right now because the body considers all the text, if you try with find(), the output is true because it finds "ideal" on "I am an [ideal]ist", and the exact() will not work as well because "I am an idealist" is not the same as "ideal", even if the key was "idealist" it will output false as well.
Any ideas?
Discussion posts and replies are publicly visible
I'm unclear exactly what it is you *are* looking for. For instance are you looking for instances of " ideal " (i.e. with whitespace / non-word characters before and after, what we might call a "whole word" search elsewhere)? Or is it something else?
Just check the java code bellow, basically we wanted to turn that into appian SAIL code.. but we can't find how we can do a foreach to compare local!corpo and !localcriterios.
I'd start with
whereContains(local!criterios, local!corpo)
...which will return an array of matches (indices in the 2nd array where value(s) from the 1st array are a match). If no matches, the returned array will be empty. You can do what you want from there with these results.
The same result is attainable via a nested a!forEach (as long as you structure it right, i think your examples above are close but both miss the mark somewhat) - but whereContains() does this work for you.
Not sure if this is what you're shooting for:
a!localVariables( local!criterios: split("teste,teste2,teste3",","), local!corpo: split("ola eu sou o carlos e tenhos teste e teste3"," "), a!forEach( items: local!corpo, expression: fn!contains(local!criterios, fv!item) ) )
which returns:
Or if simply using whereContains()...
a!localVariables( local!criterios: split("teste,teste2,teste3",","), local!corpo: split("ola eu sou o carlos e tenhos teste e teste3"," "), /*a!forEach( items: local!corpo, expression: fn!contains(local!criterios, fv!item) )*/ wherecontains(local!criterios, local!corpo) )