Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

How to send an email with a csv attached

Su
7 - Meteor

Hi everyone,

 

I have several jobs where the idea is that the output (csv file) is then sent as an attachment in an email to several people. How can I do this? The email tool in Reporting doesn't seem to work the way I expected.

 

thanks in advance.

 

Kind Regards,

Susana

12 REPLIES 12
MarqueeCrew
20 - Arcturus
20 - Arcturus
How about after a successful run you create an event to send mail? Workflow configuration should help.

Sent from my iPhone
Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
Su
7 - Meteor

Thank you very much :) It works!

mackenziek
6 - Meteoroid

You could also send an email as part of the workflow.  The data that I want to email is saved as "Media_ops" and is the only file with that name in that folder.  So every time the workflow runs it saves over the old file.  This was a much better solution than having to find a way to select a particular file out a many files.  Disregard the union, select, and sort as I was pulling in the row count so that the person I'm sending the file to can see that the data has all the records they were expecting.

 

The basic table is where I specify which records I want to see in the body of the email.  For this example I want to see in the body of the email all the records that you would see in the file.  So I select all records in the Per Column Configuration and select Show Column Headers. 

 

In the report text configuration I select attach text to existing field and select Table for the Field Name.  For position I used Place Text above existing object.  And I wrote a message that said, "The following data set was sent to Mr. Client".

 

The Layout Configuration is pretty straightforward.  Layout Mode: All Records Combined.  Orientation: Horizontal.  Data Field: Table:

 

The Email Configuration is where you need your SMTP for your email server.   You will select enabled. and where you see auto-detected SMTP you would put in your own credentials.  Then you specify who the emails will be sent to.  THIS is what you've been waiting for.  In the attachments section click Add and specify the file where you exported the single data file with the name of "media_ops" that I gave the example of.

 

 

When you run the workflow you will get an email that has the attached file of "Media_ops" and you'll see the raw data in the body of the email in a cross tab.

 

Hope this helps as I didn't find a solution I really loved because I wanted to get an email at a certain point in the Alteryx workflow, not when it was finished running.  If you just need an email when the workflow is done, then the event configuration will work just fine for sending a file.

 

 

Happy Data Blending!

-Mackenzie

 

 

Alteryx Email SetupAlteryx Email Setup

CGA
5 - Atom

Meteor,

I tried with the event in the workflow configuration and the challenge I have is that every time I run the workflow the outpupt is a file that changes the name adding the date it runs. So I wonder how I can attach that file wich the name that changes?

 

file-YYYY-MM-DD.

 

any suggestion?

Thanks

CGA

Karlo
8 - Asteroid
nimeshkhatri
7 - Meteor

Hi, I have been able to generate email with attachment as CSV on my local machine. However, another problem is to schedule this job. My end goal is to generate a CSV everyday and email it to business users. This needs the job to be scheduled in Alteryx gallery. Can someone guide on how the CSV saving to alteryx gallery and then selecting the attachment for email from alteryx gallery works? I couldn't find any guidance on that.

KasiaP
7 - Meteor

 

darryl5280
10 - Fireball

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

 

Temp Directory in a Formula.png

 

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

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

 

Temp Directory in a Tools Confiruation FiileName Field.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.

 

This will work for any file type, and add another attachment if you wanted  add another file to the email.

 

 

KasiaP
7 - Meteor

Darryl5280,

 

thanks for your hints, it helped me to achieve whta I wanted, but I needed to add step of saving file in temp directory.

Can you please look into attached workflow and let me know if there is more efficient way for handling this?

 

Thanks,

Kasia

Labels