Trigger actions based off key word in open-end comment? | XM Community
Skip to main content
I'm trying to only trigger an action/e-mail when a respondent includes a specific word in their open-end comment. For this specific use case the word(s) I'm looking to have the e-mail triggered off of is 'app' and/or 'apps'. The problem I'm running into is that I'm also getting alerts when a word like 'apply' is in the text - which is not what I want. I was told to use 'matches regex' but that still does not seem to be working. Any suggestions on how to get this functionality to work? I've added a screen shot of what it currently looks like, which is not working.!
You can try using logic "contains" and find word " app " or " apps " (add a space before and after "app" or "apps")
Why not just put spaces around the word you are looking for? Then you could even just use a Contains argument
When I try adding a space before/after the word and the 'contains' logic, an e-mail is still triggered for the word 'application'. What I'm hoping to do is only get the e-mail to trigger if a specific word is included in the comment, and not trigger if another word has the same letter configuration.
Hmm, let me test it. It’s probably stripping the spaces
Regex should work better actually. Without regex you'll miss if they use it at the beginning or end of the sentence:



`/(\\ |^)(apps|app)(\\ |[[:punct:]]|$)/gim`



This checks to ensure that immediately before `app` is either a space or the beginning of a word. It then checks that either `app` or `apps` is present, and that immediately following those are either puncuation, a space, or the end of the phrase. It is also case insensitive.
Thanks mattyb513, that seems to work. Thanks for sharing your wisdom with a new user.

Leave a Reply