I have an email that is pulling in a content area.

In that content area it doing a lookup on a data extension. The data extension should have data for that subscriber in it but in some rare cases (for whatever reason) if the lookup returns no rows we do not want the email to go out and are trying to handle it with the RaiseError function.

Here is a snippet of code:

IF RowCount(@orderrows) > 0 THEN
        FOR @I = 1 TO RowCount(@orderrows) DO
            /* Do stuff here .....  */

        NEXT @I
        RaiseError("No rows found", true)

I would expect the email to not go out based on what I read in the AmpScript docs. However, the subscribers are receiving an email that says "No vrows found". Is this function being used properly?

The email is User Initiated to a data extension. All the examples I've seen with RaiseError have been based on Triggered Sends - I'm guess that maybe the issue but wanted confirmation.

  • 1
    Welcome to SFSE! Feel free to personalize your name and feel at home - glad to you have you! – Kelly J Andrews Apr 22 '14 at 19:09

You should ask to get audience exclusion scripts turned on for this account. When enabled, it shows up as a text area in the User Initiated Send. You can write a one line ampscript expression that evaluates to boolean. If its true, the email doesn't go out. See my comment in How can I make sure the exacttarget email I've built using ampscript only sends if there are new posts in my RSS feed? for an example.

  • 1
    Props for mentioning one of my favorite underutilized features of ExactTarget. – Adam Spriggs Aug 1 '14 at 13:57

So, this should work as you are expecting - but unsure as to why it isn't. However, that being said, it would probably be better to run a query prior to send eliminating the subscribers with blank rows and only sending to the audience that should be getting the email.

The documentation explains it like this:

Please note that because the system pre-processes and builds these emails, tracking and reporting numbers include these emails despite the errors and may cause inaccuracies. Use this function to handle the errors of a small number of subscribers, rather than as a method to segment out large numbers of subscribers. Instead, use query activities and exclusion lists to handle your segmentation needs.

  • Can you please update update on this as stated in your reply's last line – mario ruiz Apr 20 '17 at 18:54
  • I no longer work there, you might try customer support to find out why. – Kelly J Andrews Apr 20 '17 at 18:57

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.