Hi,
I want to send an email using Alteryx that has 5 attachments, and if some of the attachments do not have valid filepaths (the file does not exist), exclude those attachments from the email. Is this possible?
Thanks,
Ben
Sure thing. The attached solution will get you started and shows how to use a macro to perform an Inner XML update.
In the attached solution, the "Build XML" workflow figures out what files exist (and are within the email attachment file size) that should be attached and then builds the XML code necessary for the email macro to use. The Email macro just takes the (inner) XML code and updates the attachments section of the email tool before sending the email.
@bmyles
I would go about this in the following way:
1. Use the "FileExists(" function in the Formula tool(s) to determine which files exist from within the workflow.
2. Build a macro around the Email tool that uses the list of files that do exist to update the attachments part of the Email tool.
Let me know if you have any questions.
I do not have experience with macros, so I am not sure where to start with this. Would you be able to show the general setup of the macro?
Thank you.
I am getting error while using the above formula please assist
Thank you! This macro worked for me.
I only had to make 1 small change as I was also getting the error as mentioned above: The Action "Tool #9" has an error: ParseError: expected entity name for reference at line 1 and column 92 while processing "Action_UpdateRawXml"
I had some special characters in my attachment paths, I added a formula to replace the "&" symbol with a "&" and that solved my problem.
@CharlieS ,thanks for sharing. I wonder if you can also advise how to change email body(I need use my value to replace your current email body) through your tool. I figured out how to change subject but email body seems different.