Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

Get Email Even if No Records

cbridges
11 - Bolide

I'd like to get an email after a join that gives me the record count of un-joined records, but if there aren't any un-joined records, I keep getting an error...

Error: Email (7): ComposerEmailInterface: Record#1 From Field is Empty

I've tried various methods to resolve this, like combining the matched and unmatched in a text formula like "X matched and Y unmatched records" but I can't seem to solve the problem. It's driving me a little crazy.

 

So I guess my question is, how can I get a field with no records to show up as zero?

 

The really weird part is that I have a browse at the same place in the chain as the email tool, and it's got no problems at all...

 

Report:
41 Matched Inv Prod Lines and Unmatched Inv Prod Lines
16 matched Book lines and unmatched Book lines and matched Boo

@thizviz
6 REPLIES 6
TaraM
Alteryx Alumni (Retired)

The Count Records tool: http://help.alteryx.com/current/index.htm#Macro-CountRecords.htm

 

This Macro returns a count of how many records are going through the tool.

This tool will come in handy when the user wishes to report on the resulting record count of a process. It will even return a count of zero which is a scenario that a Summarize tool will not handle.

Tara McCoy
cbridges
11 - Bolide

Perfect, thank you!

 

As a side note for others... also discovered another part of my problem. I had not designated the "From" address for the email!

@thizviz
blyons
11 - Bolide

Thank you for including your last sentence. The error "Record#1 From Field is Empty" was making me look in all the wrong places until I read what you wrote. I, too, was missing the "From" address.

SeanAdams
17 - Castor
17 - Castor

Hey @cbridges

 

I actually ran across this issue the exact opposite way - I was getting emails back even though I didn't want any.

When I plodded through this, it turned out that the reporting tool is kinda funny:

- if all you have in the e-mail is a table, then if there's no results in the table, then there's no rows in the data stream going to the e-mail ('cause the table acts as one row with a big object in it)

- if you add in a header, a footer, and a top-line with a record count - then suddenly you have 3 or 4 rows in your data stream, so even if you have no row in the table, the eMail component still has a non-zero record set to work with.

 

So for me this was a problem to fix rather than a feature :-) but for you this is exactly what you need.

 

Try this:

- Add a header

- Add a footer

- add report text saying something like "report run on dd/mm/yyyy - records returned 0"

Then you should have the ability to send zero-row record sets

 

Attached a mock-up for you to play with - just mess around with the filter on the front-end to either get zero or non-zero rows - but you should get an e-mail irrespective.

mmongeon
8 - Asteroid

This was very helpful!

 

I was running into this "Record#1 From Field is Empty" error message trying to send data formatted with the reporting tools in an e-mail.

 

I thought there was an issue with the Layout field I was passing into the Body of the e-mail, but it was about the From address being empty.

Once I figured that out, I was able to send the output formatted with the reporting tools in the body of an e-mail.

 

Thanks!

Ian_Lafford
5 - Atom

Thanks for posting - I was also scratching my head about this error, and like you, I hadn't put a "From" address. Not the most intuitive error message.....

Labels
Top Solution Authors