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

email Tool attachment and delay for reading files

VahidGoli
8 - Asteroid

Hi experts,

I need your guidance on the following scenario:

 

My workflow does the following steps:

1-Delete all the existing files in the data collection folder (by running a batch file, RUN Before)

2-start calculations and write some CSV files to the data collection folder

3-Make a zip file with timestamp (so the file name is dynamic) from CSV files in data collection and save it in a different folder

 

Now I need to add step 4 to the workflow:

4-Attaching the zip file from step 3 to the Email Tool and email it.

 

Problem: I couldn't find a way to easily attach the file with a dynamic name to the email tool.

 

I tried to read the file name by the directory input tool, but it needs some delay and waiting for the zip file to be created, and I couldn't find a way to achieve that.

 

Any suggestion or help is greatly appreciated.

 

Kind regards,

4 REPLIES 4
mst3k
11 - Bolide

add the full file path as a field with a Formula tool. enter it as literal text, concatenating whatever dynamic values you need along the way (i.e. the corresponding timestamp or whatever). you can't just put "datetimenow()" in the formula tool - the timestamps will certainly be different than the timestamp used to create your zip file. so you just need to be careful about syncing the timestamp, or whatever other values, between the name of the .zip you're creating, and the string of the full file path you're creating in the formula tool.

then in your email tool, set the attachment to reference that field with the full file path ("File Name From Field Value"). and use block until done along the way so your email tool doesn't try to attach something still being written

VahidGoli
8 - Asteroid

Thanks for your response  @mst3k  .
I knew it would be the way, but as I said, it is not possible, or at least I don't know how to do it in Alteryx. This is because the batch file creates the zip file name, and I couldn't find a way to get the files' name (I explained why it's not possible in the original question).

 

There is no way to estimate or sync the time stamp on the zip file name and the workflow timestamp creation.

 

Would you please clarify more or tell me which part I am missing from your response?

 

Thanks

mst3k
11 - Bolide

is it possible to mock up a quick and dirty workflow that removes any sensitive info you can share and shows what you're doing now? I didn't realize .zip can't be output directly - you have to use a CMD command to do it? Is that right? you should still be able to feed your filename/path dynamically into a CMD command using the alteryx tool. so you determine the filename (including user id, timestamp, etc) and feed that value into the .bat command that creates the .zip, and also feed it to the email tool as the filepath? i might be completely misunderstanding the obstacle though

VahidGoli
8 - Asteroid

This afternoon I did the same that you said. I passed the name to the file in the batch file instead of relying on the zip command to get the time from pc.

Labels