I'm trying to test if an exclusion script works in journey builder using a script like this:

ROWCOUNT(LOOKUPROWS("my-data-extension","EmailAddress", EMAILADDR))>0

How could I use the script in a test email in email studio, and modify the code to print the result of the Script? Such as, if the Ampscript code returns "1" during the preview and test with the respective data extension, it would exclude the subscriber.

Could someone help me figure out how to write the AMPscript using the V function?


You can just do something like this to output the results of the rowcount:


var @rc
set @rc = ROWCOUNT(LOOKUPROWS("my-data-extension","EmailAddress", EMAILADDR))

if @rc > 0 then

  • This worked perfectly! Thanks Adam! – Emilee Pogosov Nov 24 '20 at 15:21

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.