Dynamic folders

Hello all.

I have to download files from email every time. For example, an email received 6 files, 3 of them start with the word usa and 3 others with the word esp. I want to create a dynamic folder called usa and put the files that started with usa in it.

I need advice or something that can help.
Thank you .

the name of folders that can be recived like that :
esp_com , esp_sap , esp_for
usa_com , usa_sap , usa_for
.
.

Hi,

After downloading attachments to a specific folder, and then you can loop in this folder. For every file in this folder, use Path Exist to control there is a folder with this file name.
If there isn’t a folder use Create Folder activity to create a folder and use Move To activity to move file.

To take first 3 characters of file you can use:
Path.GetFileName(file).Substring(0,3)

1 Like

Well, what condition do I have to add for files with similar names after I get all the names through Loop,
For example I got the name usa and the name esp…
and then i want to loop in all usa in first itration and the seccond one for esp…

In this case, firstly you can collect different names.

After that, loop in the unique names(myList) list to get files in order

I hope it works for you

1 Like

thank you so much,
if you can please attach this .xmal fil here

1 Like

You’re welcome!

Sequence1.xaml (14.3 KB)

Edit: Item property of the Add To Collection activity value should be like this: Path.GetFileName(item).Substring(0,3)

I updated my sequence please check it.

this is the updated one

Download again :slight_smile:

1 Like

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