-2

I need exclusion script for Trigger send definition to exclude records on type of activity.

This is sample table that is sendable: Sample_Customeractivity_table

I have another trigger DE trigger_customeractivity_table where i am saving the trigger records.

i have 10 types of emails for 10 types of "typecode",

In 1st script - i want exclude all type2 to type10

In 2nd script - i want exclude all type1 and type3 to type10

In 3rd script - i want exclude all type1 and type2 and type4 to type10

In 4th ...

etc

Here is what I have tried so far:

Not Empty(Lookup("cus_activity","EmailAddress","typecode","type1‌​") OR 
Not Empty(Lookup("cus_activity","EmailAddress","typecode","type2‌​") OR 
Not Empty(Lookup("cus_activity","EmailAddress","typecode","type3‌​")
  • Have you attempted to write the AMPScript for it? If so, please update your question with what you've got so far. If not, please try it first. – Adam Spriggs Oct 12 '17 at 22:21
  • @AdamSpriggs i tried with this script ` Not Empty(Lookup("cus_activity","EmailAddress","typecode","type1") OR Not Empty(Lookup("cus_activity","EmailAddress","typecode","type2") OR Not Empty(Lookup("cus_activity","EmailAddress","typecode","type3") ` but no success. – Ranjith Haridas Oct 13 '17 at 9:25
0

You can't use empty() to check lookup() results. The Lookup() function returns a rowset.

Your best bet would be to use the rowcount() function.

Also, I'm assuming that your typecode values are in your send context, so you'd either reference them without quotes or using the AttributeValue() function.

Will work, but not recommended:

rowcount(Lookup("cus_activity","EmailAddress","typecode", type1) > 0 OR
rowcount(Lookup("cus_activity","EmailAddress","typecode", type2) > 0 OR
rowcount(Lookup("cus_activity","EmailAddress","typecode", type3) > 0

This is better:

rowcount(Lookup("cus_activity","EmailAddress","typecode", AttributeValue("type1‌​")) > 0 OR
rowcount(Lookup("cus_activity","EmailAddress","typecode", AttributeValue("type2​")) > 0 OR
rowcount(Lookup("cus_activity","EmailAddress","typecode", AttributeValue("type3​")) > 0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.