We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Multiple attachments from different folders to add to output emails

VictoriaBudak
7 - Meteor

Hello, thank you for reading. I am quite new to Alteryx and haven't yet created any macros. 

I have a workflow which sends emails about Incidents my team looks at and I need to attach some files (supporting evidence) to the emails. These files will be saved on our team shared drive in folder "Incident", subfolder "2025" and then sub subfolder "June" and then it will have the specific folder created for that Incident, e.g.  "Incident123". Obviously, in July, the path will change to "July".

Is there a way in Alteryx to pick up all files from our shared drive folder "Incidents" from the folder "Incident123". I have user tool already to input Incident number (e.g. Incident123) to create a report and an email, but also need all evidence (could be 1 attachment, could be 7) to be picked up from the folder with the same name. How do I do that? Do I need a lookup tool? Macro? Please help. 

2 REPLIES 2
mceleavey
17 - Castor
17 - Castor

Hi @VictoriaBudak ,

 

You can read in the files using the Directory tool and check the "Use Sub-Folders" option. You can then handle the change in months in one of two ways:

 

1. Read in all docs and then filter to where the fullpath contains current month. This will always retrieve those files from the current month folder.

2. Create a batch macro and feed in the current month as the control parameter. In the macro, overwrite the section of the path in the directory tool that specifies the month.

 

Both will work but the second option will be more efficient if you have a large number of documents.

 

M.



Bulien

Dhrish
8 - Asteroid

@VictoriaBudak as suggested by @mceleavey you use the DIRECTORY tool to get the fullpath of all the required files, for the files to be added as attachments you can add a FORMULA tool, add a new field XML_Attach with expression:

'<Attachment> <ValueIsField value="False" /> <Value>'+[FullPath]+'</Value> </Attachment>'

After this add a SUMMARIZE tool to concatenate the XML_Attach field with no delimeters. Send this to a macro as shown in snip. The control parameter will take the concatinated value and set the action tool as shown in 2nd snip. This will attach all the files in the email.Screenshot 2025-06-10 114841.pngScreenshot 2025-06-10 115050.png

Labels
Top Solution Authors