Rename 3 email attachments

Hello, I have an email that always contains 3 attachments. Each time the attachments will have the same names BUT will have a date range within the file name making them dynamic.

Example - SACT_v3-20220101-20220131_admin.csv

the bit in bold is dynamic (it is the date range).

I am saving the attachments, but need to rename this file to just “adminfile.csv”

Please can you help how I can always rename the file to adminfile (which will over right the previous) when the attachment has a dynamic date

Hi @CMB80,

Welcome to the community.

One alternative approach can be, create a temp folder and save the attachments in it firstly post that Move the attachments to desired folder while moving Rename them with your desired name. This will do what you require.

Thanks

hello, yes thank you - but how do I do the actual renaming? The file names will be dynamic so how do I know what to rename them from?

HI @CMB80

So only the date will be changing right? Try this methods
Method 1:

  • Use Move file and use wildcards in the source name like this
    image

Method 2:

  • Use For each file in folder pass your path upto folder name
    • Use Move file
      image

Hope this helps

Regards
Gokul

Hi Gokil001 - thanks, first method will not allow illegal characters in path.

Method 2 - can you post xaml as I do not follow the process

Sure I will give you the skeleton which i shown you can develop based on your requirement

Regards
Gokul

1 Like

Hi @CMB80

Here is the sample xaml

Main.xaml (6.6 KB)

Regards
Gokul

Thank you - I will take a look

Hi @Gokul001 this doesn’t seem to do anything?

the file names stay as they are.

The xaml has “read csv” but your original image had move file

Aww Sorry for the bitter mistake

Here is the updated xaml
Main.xaml (6.6 KB)

Regards
Gokul

1 Like

@Gokul001 Thank you - but it still does not do anything.

I have 3 csv files in the folder which are from the attachments - they are called

SACT_v3- 20220101-20220131 _admin.csv
SACT_v3- 20220101-20220131 _data.csv
SACT_v3- 20220101-20220131 _pass.csv

(The bits in bold will change if when I download attachments next month)

I want to rename them too

adminfile.csv
data.csv
pass.csv

In which folder the the attachments are available in your system?

@Gokul001 G:\DataInfo\Management\Targets\Reports

And you are using this same path right?

Yes always the same path

And your Destination path is ?

Destination path means the path in which you need to move the attachment with new name

1 Like

I don’t need to move it - just keep in same folder with new name

Hi @CMB80

Here is the workflow

Main.xaml (10.3 KB)

Regards
Gokul

3 Likes

Hi @CMB80

If your query get resolved. Kindly mark the post as solved.

So it will help for others to

Regards
Gokul

@Gokul001 - that you so much, it works. I couldn’t reply yesterday as I was locked out by the forum

1 Like