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:
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.
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:
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!
Solved! Go to Solution.
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.
@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)
But I get this error:
Any idea what's wrong here?
Thank you!
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.
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?
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.
@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!
It's all working perfectly! Big thanks to @apathetichell for getting me there!