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.
current set up in designer.
@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?
Hi @DataNath ,
Below is the formula tool
the Output data tool
Below is the email configuration
expanded view of workflow
Does this answer your question? I'm thinking your right here, with something in output is not syncing with email attachment
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.
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
Results pane from Output data
Error in Email tool
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!
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.
In Email Tool, Click on Attachments, and then the “Add” button.
And for the "Specifiy File" enter: %Engine.TempFilePath%YourFile.csv
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.
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!
@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!
User | Count |
---|---|
19 | |
14 | |
13 | |
9 | |
8 |