Thank you, Ian. Exactly what I needed. And thank you to a few of the anonymous community members who messaged privately with the same solution. Greatly appreciated!
Original Message:
Sent: 03-07-2025 09:17
From: Ian Chamberlain
Subject: DREL Filter Expression for "Not Equal" in Email Filtering
Hey Matt!
The filters on Data Destinations use Regular Expressions to determine if it's going to be triggered or not. I would like to pretend that I am an expert with RegEx but I will typically lean on ChatGPT to help me build the expressions that I need.
Just like you have pointed out, if you want to trigger the destination when an answer matches something (in this example I am going to match on banana), you will have ^banana$. In this case, the ^ indicates the start of a string and the $ indicates the end of a string, so ^banana$ would not match bananas for example.
In order to perform a "negative" match, you use what is called a negative lookahead. For example, if you want to match on everything other than banana (so trigger the destination as long as the answer is not banana) you can use this expression: ^(?!banana$).*
To break this down a little more:
^
asserts the start of the string.
(?!banana$)
ensures that the string is not exactly "banana" (it won't match if "banana" is the entire string).
.*
then matches any characters (including an empty string) for strings that passed the negative lookahead.
Using this, you can replace banana with John May if you want the email to go out whenever that question is answered with anything other than John May. ^(?!John May$).*
I hope this helps!
------------------------------
Ian Chamberlain
Solutions Architect
TrueContext
Original Message:
Sent: 03-06-2025 19:24
From: Matt Lambert
Subject: DREL Filter Expression for "Not Equal" in Email Filtering
Hi Community. I have gotten to do a little form building with a new acquisition in our group. Curious to know if there is an easy filter expression for "not equal" that I can write in an email data destination we are using.
I want to refer to a dropdown question (Contact) that has four options: John May, Ed Lust, Brock Cowan, and the "Collect a text response with an "Other" option". One email destination filters for an exact match to John May by using Input Expression %a[Contact] and Filter Expression ^John May$. That sends emails to a specific customer distribution list that should not receive submission for any other Contact.
I would like to have the other email destination filter for any other possible answer by writing something that indicates not equal (<>, =/=, etc.). Is that possible? I can easily find how to filter on positive matches, but having a harder time confirming whether I can filter by using "not equal" logic of some kind in the email data destination filter.
Before someone wastes time typing out this answer: I know one option is to create a hidden question in the form called "John May?" that defaults to Yes if that is the dropdown answer and is set to No for all other answers. I would then refer to that question to have my second email destination capture all other responses. I am trying to expand my knowledge of how the filtering could work so I thought I would check here before I added that question and created one more form version.
------------------------------
Matt Lambert
Vice President of Operations
PrimeLine Utility Services
Matt.Lambert@primelineus.com
------------------------------