cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Bill51106
Helper III
Helper III

Adding date and time fails the flow

Before the Flow worked great. The file name would always stay the same and I wanted to add a time stamp. I added this function

"formatDateTime(utcnow(),'Pacific Standard Time''MM-dd-yyyy hh:mm tt')" and now the flow fails, I also added .xlsx to the end thinking that was the problem. This function works on my other flows, what am I missing?

Capture.PNG

3 REPLIES 3
PrasadAthalye
Super User
Super User

I think the format DateTime function returns time with a colon in it which can not be used in filenames. It's a special character. I put together the following expression. Can you try it?

 

replace(replace(convertFromUtc(utcNow(), 'Pacific Standard Time'), ':'''), '.''')
Please Like and Mark this as Answer if it resolves your Issue.

Power Automate Community
Bill51106
Helper III
Helper III

@PrasadAthalye First, thank you for responding. Previously my function worked to timestamp files and produced "filename 04-04-2021 11_30 PM.xls" now it fails, with your code it produces "filename.xlsx2021-04-0409321199445922 "

Bill51106
Helper III
Helper III

I figured out what the problem was, my previous file creations needed me to build the file name and I could add in functions and finish it off with .xls.

 

This flow is different I see, it creates the entire file name. I got around this by placing this function prior "convertTimeZone(utcnow(),'UTC','Pacific Standard Time','MM-dd-yyyy hh:mm tt')"

Capture.PNG

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.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Top Solution Authors
Users online (979)