We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Sending email if row count is 0

ericren
8 - Asteroid

I want to send an email body , if there are no row counts for a chart.

 

If a filter/dataset returns 0 rows, send email.

9 REPLIES 9
alexnajm
18 - Pollux
18 - Pollux

Hi @ericren,

 

I would look at using a Count Records tool to get at least one row (it would just be the number zero if there are truly no records) which can then feed into the Email tool to send out an email!

 

You can customize the body further using a Formula tool or a Report Text tool, but without more info it's hard to know if that's what you are looking for!

 

-Alex

ericren
8 - Asteroid

I have the following set.

 

Type Value
Blue4.23
Green

2.23

 

 

If there are no values greater than 1, there are no rows in the filtered selection. 

I'd like the following email output with the chart included. 

 

Email output:

 

There are no values greater than 1

 

Type Value
Blue4.23
Green

2.23

alexnajm
18 - Pollux
18 - Pollux

Hi @ericren,

 

The Count Records Tool will create a row no matter what - it will either be the number of rows or it will be 0. I attached an example based on the data you gave.

 

Let me know if you have any further questions!

 

-Alex

ericren
8 - Asteroid

Thank you, this worked perfect.

 

How would I attach a 2nd dataset to the email output with same conditions in the first data set.

 

Attach dataset below to email if the original dataset in this thread returns 0 rows.

 

ColorNumber
Orange3
Purple2

 

alexnajm
18 - Pollux
18 - Pollux

Hi @ericren,

 

Fantastic! Can you accept that answer as a solution then when you get a chance?

 

I'm not sure I fully understand the second part - based on the information given and my assumptions, attached is what I am guessing. I converted the Body field into a reporting snippet via a Report Text tool, and I converted the 2nd dataset into a reporting snippet via a Table tool. They need to be put together on the same line so the Layout tool can work - I used an Append Field tool to do this but it'll depend on the data.

 

-Alex

ericren
8 - Asteroid

Will the 2nd data set be read and sent even if there are rows from the first dataset's filtering results?

alexnajm
18 - Pollux
18 - Pollux

In the solution I built, yes!

ericren
8 - Asteroid

How would you change it so that that 2nd dataset is only sent when the first data set filtered results in 0 rows?

alexnajm
18 - Pollux
18 - Pollux

I would do something like this: Solved: Conditional Email Send - Alteryx Community

Labels
Top Solution Authors