How can I do that folder will be automatically added to an email

Hi all

I have different emails to send to different clients. In each email I add zipped folder as attachment.
I managed that the email adress is automatically added from an excel, however how can I automate that the corresponding folder will be added?
figure 1
figure 2

Hi @regi0001

You can use the for each file in a folder to iterate through all the files in the folder. As you need to attach the correct zip folder, i have added a If block which will check the no (eg. 231117) in the zip folder names.

When you find the correct match you assign the path of that folder to variable in this case (FullAttachementPath). You can use this variable in your Send mail activity. Keep the mail activity outside the for each loop.

Hope this helps :slight_smile:

Thank you,

one question if I enter in the if Condition the number e.g. “231117” then he would never add the next folder with the number “231118” right?

Yes correct. We can make it dynamic also. You can put a variable in contains condition with unique value for your required folder.


I’m sorry since I’m a beginner, what do you mean with create a variable. So I have to Assign a variable with for eg. “Ausgangsrechnung Nr_” and the number is then variable? or how do i move forward best?

Hi @regi0001

When you are using the for each excel row. You can split the Invoice no field in excel to identify the folder & assign it to another variable in this case i have assigned it to InvoiceNoExtracted. (Which will only give the value 231117)


That Value we can use in the if condition.


Find Attached the Flow For Your Ref: (33.5 KB)

Hope this helps :slight_smile:

Thank you soooooo much.
It works great.

Hi @regi0001

I think you are new to the UiPath Forum. :slight_smile:
You need to accept my reply as solution & not your own. So that it will help others also to find the solution.


oh dear
thanks for the info,

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.