Free Trial

Alteryx Designer Desktop Discussions

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

How to email .csv file from S3 bucket in Gallery

pozzyal
7 - Meteor

I have a workflow which creates a .csv file in an S3 bucket. After the file is created, I need to have Alteryx attach it to an email and send. I have no access to network drives, this has to happen directly to and from S3. The problem I'm running into is that when I use the S3 download tool to get the .csv, it's bringing it back as data, rather than as a .csv file. How do I get it to grab the actual file and attach it to the email? I'm assuming it's a problem with the path.

 

Here's my configuration of the S3 tool:

S3 config.png

 

Here is the output, which is 1,498 rows, when really I think I want one row which contains the .csv file. I'm showing the headers and not the actual records for data privacy reasons.

record count.png

 

 

So I then need to attach the .csv. If I try to find it by clicking the file folder, it takes me to my local file system, rather than my S3 bucket. So I tried creating a filepath, but that doesn't work either:

filepath.png

 

I'm assuming this can be done, and most likely need to define the path differently, but so far I can't figure it out. Is there a solution?

 

Thanks!

7 REPLIES 7
apathetichell
19 - Altair

Two ways:

1)  use a formula tool to create a filename/path. attach a Block until Done to your formula tool use an output tool to write your file to your path.

part two of BUD -> blob input your filepath -> send to email as path.

 

2) Use AWS S3 CLI to download your file locally via run command - you may want to keep your formula part from 1) to pipe to that file. use blob input tool - > use email tool.

 

 

pozzyal
7 - Meteor

@apathetichell Thank you for the reply. I am trying to do option #1 by creating the file path (or attempting to anyway), but it doesn't seem to work. I'm not sure if I even have the correct path, but here's my attempt (with company name blacked out)

filepath.png

 

But I get this error:

Screenshot 2025-05-05 093245.png

 

Any idea what's wrong here?

 

Thank you!

apathetichell
19 - Altair

You must download the file locally. The path you are creating is to identify where on your local machine the file is being downloaded to. Part 1 of BUD -> download locally to a specific path. Part 2-> take path you downloaded to from 1) and attach.

 

pozzyal
7 - Meteor

Ahh, thank you, that makes sense. The problem here is we're using Gallery and we have no file system connected to the server due to company policy, and there's no local machine to download to, as it's an automated process not tied to an individual. Is this not possible under these conditions?

apathetichell
19 - Altair

Hey - no. that's not true. You may mean that there is no persistent storage (like a network drive) - but Alteryx runs on a Windows machine. At run time a temp directory is created and the workflow runs in a directory it will also create a temp filepath. You can get those location in a formula tool via the engine workflow directory (or engine temp directory) using constants (see https://help.alteryx.com/current/en/designer/tools/preparation/formula-tool/constants.html). That is why the formula tool path that you create is so crucial. The location is dynamic and you must use teh same for both the S3 download location and the email attachment location. I'd recommend using the temp path because (not 100% guaranteed - but hypothetically) all of the files are ephemeral and deleted/removed when your workflow is finished. 

pozzyal
7 - Meteor

@apathetichell Thank you for the clarification! I should have thought of it, I do that on my local machine anyway using the filepath it returns. I assume I can get it to work now, but before I mark this as accepted I'm going to play with it, in case I run into anything else and you're still willing to help me get over the finish line. Thanks again!

pozzyal
7 - Meteor

It's all working perfectly! Big thanks to @apathetichell for getting me there!

Labels
Top Solution Authors