Adding timestamp (MM/dd/yyyy) to files dowloaded from SharePoint

Hi team,
I want to download the excel file from a sharePoint and drop it into my Data folder under my project.
However, I want the file to have time timestamp before being stored in the folder.
image

Can anyone help!

Cheers!

Hi @Sisay_Dinku

You can add the time stamp like this:

yourFileName+"_"+Now.ToString("MM/dd/yyyy")+"[file extension]"

Hope this helps,
Best Regards.

@arjunshenoy

Where can I add that? from the above screenshot.
Path.Combine(Environment.CurrentDirectory, “Data”,“temp”)

@Sisay_Dinku

Try this

Path.Combine(Environment.CurrentDirectory, "Data","temp-" + Now.ToString("yyyy-MM-dd") + ".filetype")

/ and \ are not allowed in folder/file names.

@Sisay_Dinku

In the above expression, you can add it like this:

→ In as Assign activity, initialise file path:

yourFilePath = yourFileName+"_"+Now.ToString("MM/dd/yyyy")+"[file extension]"

→ Then include it in the expression:

filePath = Path.Combine(Environment.CurrentDirectory, “Data”,“Temp”,yourFilePath)

image

Hope this helps,
Best Regards.

@argin.lerit
you’re correct that / or \ are not allowed.

Thanks a lot!

@arjunshenoy

Great! Thanks!

1 Like

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