Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Announcement | We'll be doing maintenance between 2-3 hours, which may impact your experience. Thanks for your patience as we work on improving the community!
Free Trial

Alteryx Designer Desktop Discussions

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

email tool error when trying to attach an excel file

sammyb84
8 - Asteroid

Hi all,

 

I'm trying to send an email with an attachment but get the below error from the Email tool.  I have made sure that the output Data tool is configured properly with my formula tool creating an 'xslx' file and have confirmed that the files are indeed in the folder.  I've read a few discussions on this before but I'm not finding a solution just yet.  

 

 

sammyb84_0-1664896700518.png

current set up in designer.

sammyb84_1-1664896925311.png

 

 

10 REPLIES 10
DataNath
17 - Castor
17 - Castor

@sammyb84 can you show more of your configuration? Perhaps more screenshots or share your workflow? From the error message it looks like the file you're outputting and the one you're referencing as the email attachment are different - is this intentional?

sammyb84
8 - Asteroid

 

Hi @DataNath ,

 

Below is the formula tool 

sammyb84_1-1664898988922.png

 

the Output data tool

 

sammyb84_2-1664899064454.png

 

 

Below is the email configuration

 

sammyb84_0-1664898626849.png

 

expanded view of workflow

sammyb84_3-1664899185350.png

 

 

Does this answer your question?  I'm thinking your right here, with something in output is not syncing with email attachment

DataNath
17 - Castor
17 - Castor

Thanks a lot for that @sammyb84. So, from your Output Data tool it looks like you're creating an Excel file called 'Output', with the sheet name as '[Master Vendor]' (if you're wanting to reference the master vendor field, you'll need to generate this path in the formula tool as you are for your other path - you can't make it in the Output Data path configuration).

 

Then, in your email tool, you're referencing the path being created in your formula tool, which I can see is creating an excel for each [Master Vendor], with the sheet name as 'Sheet1' and so what you're outputting vs what you're referencing are totally different.

 

As you want to use the same file & location for your output/attachment, I'd just make a formula tool for each stream with the exact same expression and reference them both in the Output Data tool/Email attachment respectively.

sammyb84
8 - Asteroid

That makes total sense @DataNath .  Thank you.

 

Seems I am still getting error so I'm thinking still missing a step here.  I've tried to eliminate nuances with spacing etc that might trigger errors.

 

Here is revised Output Data

 

sammyb84_0-1664901605139.png

 

Results pane from Output data

sammyb84_2-1664901756235.png

 

 

Error in Email tool

sammyb84_1-1664901687425.png

 

DataNath
17 - Castor
17 - Castor

Hmm, if the 2 paths are exactly the same then it might just be an issue with the file not being created by the time the email tool looks to attach it, even with the Block Until Done in place. If you move the email stream to anchor #2 instead of #3, does this help? If not, then it may be worth Rendering the Excel output to a temp location and referencing it as shown here: https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Email-Output-Error-Need-Help-Please/td...

Hi @sammyb84 

 

Try to remove the sheet name from the path that will be used in the email tool, for attachment.

 

EX: Path to update output: c:\user\MasterVendor.xlsx|||sheet1

 

         Path for Email to be used as attachment: c:\user\MasterVendor.xlsx

 

 

You can simply use a formula tool to create a second field for the attachment that replaces "|||sheet1" with nothing.

 

Hope that helps. Cheers!

gautiergodard
13 - Pulsar

As an alternative, instead of outputting the data via output tool, you could create a temporary output which gets picked up by the email tool. Sharing the link below to give a detailed step by step as to how this can be done. Solved: How to send an email with a csv attached - Alteryx Community

 

With the Formula Tool, create a Filename with [Egine.TempFilePath] in front of it.

 

gautiergodard_0-1664913311662.png

 

 

In Email Tool, Click on Attachments, and then the “Add” button.

And for the "Specifiy File" enter:   %Engine.TempFilePath%YourFile.csv

 

gautiergodard_1-1664913311670.png

 

 

The Temporary Directory is %Engine.TempFilePath% when used in a Tool’s Configuration for a File but when it’s in a Formula it’s [Egine.TempFilePath] . And since it's the Temporary Directory Alteryx will automatically delete it after your workflow has finished running.

sammyb84
8 - Asteroid

Since I needed to do some formatting to the headers of some columns, I went ahead and used Basic table and Render which requires that i remove Sheet1 all together.

 

Thanks for this simple solution!

 

 

sammyb84
8 - Asteroid

@gautiergodard this would be handy if I didn't want to keep the files but in this case for now I believe we want to keep them.  But good to know that this is an option.  

 

Thank you for taking the time!

 

 

Labels
Top Solution Authors