How to prevent triggering an action when regex matches NOT 12? | XM Community
Skip to main content
Solved

How to prevent triggering an action when regex matches NOT 12?

  • May 24, 2019
  • 2 replies
  • 19 views

Hello, I would like to prevent triggering an action (email) every time a phone number starts by 12. I use embedded data PhoneNumber matches regex ^(?!12).* but I keep receiving the triggered email => unexpected behaviour If phone number starts by 11, I well receive the triggered email => expected behaviour Any idea why "Not starting by 12" which is ^(?!12).* doesn't prevent the trigger? I'm looking forward for your support 😀

Best answer by NiC

Hi @David This ("^(?!12).*") seems to be working fine for me Here is a preview link i created with your regex https://ugamsandbox.ca1.qualtrics.com/jfe/preview/SV_abNzDzoUrn4MxUh?Q_SurveyVersionID=current&Q_CHL=preview

2 replies

NiC
QPN Level 5 ●●●●●
Forum|alt.badge.img+27
  • QPN Level 5 ●●●●●
  • Answer
  • May 27, 2019
Hi @David This ("^(?!12).*") seems to be working fine for me Here is a preview link i created with your regex https://ugamsandbox.ca1.qualtrics.com/jfe/preview/SV_abNzDzoUrn4MxUh?Q_SurveyVersionID=current&Q_CHL=preview

  • Author
  • May 28, 2019
Hi @NiC Thanks a lot for checking it! I found the issue 😉 It didn't work because I was using this condition multiple times under the condition [ANY]. Indeed, if phone number starts by 12 or 38, no trigger should be done. And if it starts by 11, email should be triggered. To make it work I have to add a new condition set [ALL] as on the picture: ! Thanks a lot for your help, it reassured me I was on the right direction 😊