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.
SOLVED

sending the emails

Neffri
8 - Asteroid

Hi,
If is possible to send the email with excel (which contain few sheets) attachment?

I need to send the email to several recipients.

Example:

Neffri_0-1674036604442.png

each excel file should go to the person from the list:

Neffri_1-1674036786215.png

I would appreciate any advice :)

13 REPLIES 13
Felipe_Ribeir0
16 - Nebula

Hi @Neffri 

 

Just replace both by any file that you have access. These files doesnt really matter since the macro will do the job of replacing these parameters.

Neffri
8 - Asteroid

@Felipe_Ribeir0 thank you very much :)
Can you please explain me why we need to give 2 dummy files in the attachment? 
Which part of the workflow is responsible to switch these two dummy attachments to what we want to have there? Is it XML_Attach formula?

THANK YOU!!!

Felipe_Ribeir0
16 - Nebula

Hi @Neffri , you are welcome 😊

 

Maybe it is a good idea for you to take a look at an introduction to macros, it is really useful to undestand how they work for a lot of different problems: https://community.alteryx.com/t5/Interactive-Lessons/tkb-p/interactive-lessons/label-name/Macros

 

This tool of the main workflow is a batch macro. On this case, this means basically that you can pass columns as parameters to it, and the macro will run 1x for each row that you pass. We are passing to it each email and attachments associated with it, and we have 3 rows, so it will run 3 times:

 

Felipe_Ribeir0_3-1674643263054.png

 

 

Inside of the macro, you can see this 'gear' tool. This is the input of the parameter Concat_XML_attach column of the image above (and the other one of the email column):

 

Felipe_Ribeir0_2-1674643160992.png

 

And finally, the update tool will pick the data from the 'gear' and update this value inside of the email tool, so for each run the email tool will know exactly to who send the email and which attachment is associated with it. The replaced value is the clicked value:

 

Felipe_Ribeir0_4-1674643426969.png

 

The tricky part of this macro is that for the email you can just replace the value (email1@company.com, email2@company.com...), but for the attachment, you need to replace the XML code. This is a little more advanced, but you can see that for attachments you have multiple values, and as you have a variable number of values (attachments), the trick of replacing values will not work here and you will need a more advanced trick.

 

Felipe_Ribeir0_5-1674644058387.png

 

But dont worry too much about the XML construction part right now, most macros will work just by replacing the value, like we did for the email column.

Neffri
8 - Asteroid

@Felipe_Ribeir0  YOU'RE MY HERO!

Labels
Top Solution Authors