cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Milese
New Member

Adding timestamp to file name

Hello all!

 

What I'm trying to achieve : whenever a file is modified in a sharepoint 365 folder, copy the file into a subfolder AND add the timestamp of the modification to the its file name.

 

Thanks to the template "when a file is created or modified in a folder... Copy file" I managed to get it done, except for adding the timestamp.

I tried to use the dayofyear function but it seems to be able to only add a predetermined day of the year and does not grab on the fly the current day of the year.

 

1- do you know if what I'm trying to achieve is possible?

2 REPLIES 2
abm
Super User III
Super User III

Hi @Milese 

 

If you after todays date then use the below expression:

 

To get current year

formatDateTime(utcNow(), 'yyyy')

 

To get current month

formatDateTime(utcNow(), 'MM')

 

To get current day

formatDateTime(utcNow(), 'dd')

 



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials
CFernandes
Super User III
Super User III

Hey Mate

 

@Milese 

 

You can add a compose action and Build the File name with Modified timestamp and pass it to the Create file action.

 

In the Formula below, I am using the Concat function to build the file name.

 

The FilenameWithExtension and Modified is the output of the Get File Properties action 

 

concat(outputs('Get_file_properties')?['body/Modified'],'-',outputs('Get_file_properties')?['body/{FilenameWithExtension}'])

 

CFernandes_0-1602665692676.png

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

 

 

Helpful resources

Announcements
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (44,451)