Trigger actions based off key word in open-end comment? | XM Community
Skip to main content
Solved

Trigger actions based off key word in open-end comment?

  • July 25, 2018
  • 6 replies
  • 126 views

aurness
Level 1 ●
Forum|alt.badge.img+7
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.!

Best answer by mattyb513

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.

6 replies

MohammedAli_Rajapkar
QPN Level 5 ●●●●●
Forum|alt.badge.img+20
You can try using logic "contains" and find word " app " or " apps " (add a space before and after "app" or "apps")

mattyb513
Level 4 ●●●●
Forum|alt.badge.img+6
  • Level 4 ●●●●
  • July 25, 2018
Why not just put spaces around the word you are looking for? Then you could even just use a Contains argument

aurness
Level 1 ●
Forum|alt.badge.img+7
  • Author
  • Level 1 ●
  • July 25, 2018
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.

mattyb513
Level 4 ●●●●
Forum|alt.badge.img+6
  • Level 4 ●●●●
  • July 25, 2018
Hmm, let me test it. It’s probably stripping the spaces

mattyb513
Level 4 ●●●●
Forum|alt.badge.img+6
  • Level 4 ●●●●
  • Answer
  • July 25, 2018
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.

aurness
Level 1 ●
Forum|alt.badge.img+7
  • Author
  • Level 1 ●
  • July 26, 2018
Thanks mattyb513, that seems to work. Thanks for sharing your wisdom with a new user.