Why does my test for no data not work?

I want to send the results of a query, if there are any such results, in an email.

All works well. But when there are no results, the email is still being sent, with an empty table
(just a header row).

I ensured that “Continue the execution of the route even if the module returns no rows” is set to No, but I still got the email.

So, I then added a filter to check if there’s an ID value (in a column called strCID) before proceeding down that route, but even with this in place, the email gets sent.

I’ve attached a couple of screenshots to show what I’ve done so far…

What am I doing wrong?!
Thanks

Hi Andrew! Can you send a printscreen with the result from SQL?


Thanks, Helio!
Wemakefuture
If you have questions reach out :wink:

1 Like

Sure.
Here’s what happens if I execute that query within SQL:

No data at all.

Here’s what the email looks like:

Which, I guess, technically matches the query - if you SELECT from a SQL View, you’ll always get the headings, even if there’s no data, so I got an email with headings and no data.

But obviously, I don’t want to continue with the automation if there’s no data.

What you can do is update the filter with a conditional to not pass if the row result has a heading data (or only one column title name). I think it will solve this.


Thanks, Helio!
Wemakefuture
If you have questions reach out :wink:

1 Like

How do I do that? What would the test look like? Can you send a screenshot or similar?

And as a matter of interest, why would that option / toggle of “Continue the execution of the route even if the module returns no rows” not work? Surely this is exactly that scenario?

Seems like make issue and I suggest you open a ticket for it.

What you can do is as suggested by @Wemakefuture, In the filter that you have(as in the screenshot above), add an AND Filter with strcid not equals to string strcid(assuming that this is what you get if the row is empty, right?).

1 Like

OK. That makes sense - I’ll try tweaking the filter like that.

I started the process by attempting to open a ticket, which is when I essentially got the reply “We can’t support free subscribers” (despite not being a free subscriber) and heard nothing since!

Thanks for your help.