1

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?

1 Answer 1

2

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
  output(concat("<br>excluded"))
else
  output(concat("<br>sent"))
endif

]%%
1
  • This worked perfectly! Thanks Adam! Nov 24, 2020 at 15:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .