cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
eden
Helper I
Helper I

Convert Datetime to String in flow?

Hello 

 

I am trying to create a flow as follows 

One drive.JPG

 

How can i create a foldername with datetime as the name, i tried  'Received Time" but its giving an errror?

 

Anyhelp will be appreciated 

 

Regards

1 ACCEPTED SOLUTION

Accepted Solutions
tom_riha
Super User II
Super User II

Hello @eden ,

you can use the 'Received Time', but you must format it using the formatDateTime(...) expression. If you use the full 'Received Time' it contains also the time, and the time includes : character = invalid character in folder name.

Use formatDateTime(...) to format the date into the desired format 'ddMMyyyy'.

formatDateTime(triggerOutputs()?['body/receivedDateTime'],'ddMMyyyy')

And you should add also the / before the expression to use it as a folder name.

image.png



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

View solution in original post

2 REPLIES 2
tom_riha
Super User II
Super User II

Hello @eden ,

you can use the 'Received Time', but you must format it using the formatDateTime(...) expression. If you use the full 'Received Time' it contains also the time, and the time includes : character = invalid character in folder name.

Use formatDateTime(...) to format the date into the desired format 'ddMMyyyy'.

formatDateTime(triggerOutputs()?['body/receivedDateTime'],'ddMMyyyy')

And you should add also the / before the expression to use it as a folder name.

image.png



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

View solution in original post

Yours  expression works  works for me  ,

 

i have one more solution which i was able to come out 

 

fLOW TIME.JPG

 

This will convert the datetime to string format like  Saturday,March 2021 

 

 

 

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Users online (2,404)