cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Derek4
Resolver I
Resolver I

How to generate PDF file with date and time as file name

Hi everyone,

 

I'm build a flow which capture the user input to a word template and then convert the word file to PDF, everything is ok until I try to add date and time to the file name. I use this expression as my file name:

 

 

FormatDateTime(utcNow(),'s')

 

 

this is how my flow looks:

微信截图_20210608112929.png

 

 

this is the error details:

 

微信截图_20210608113033.png

 

this is the input of the "convert word to pdf" action

微信截图_20210608113351.png

 

I think it the space in the file name that prevent the action to access the file, but I don't how to get rid of them, can anyone help me?

2 ACCEPTED SOLUTIONS

Accepted Solutions
NiloferA
Super User
Super User

Hello @Derek4 ,

Can you change your expression to FormatDateTime(utcNow(),'dd-mm-yy') and try if it works?

In case if it does not, please expand the individual actions within the scope and post screenshots and also the error you may get after trying this out.

View solution in original post

Hi @NiloferA ,

 

I tried this:

concat('-Print-Date-',FormatDateTime(utcNow(),'yyyy-MM-dd'),'-Time-',FormatDateTime(utcNow(),'hh-mm-tt'))

 and everything is ok now, looks like generate PDF action must use '-' to work and can't have empty space...

View solution in original post

4 REPLIES 4
NiloferA
Super User
Super User

Hello @Derek4 ,

Can you change your expression to FormatDateTime(utcNow(),'dd-mm-yy') and try if it works?

In case if it does not, please expand the individual actions within the scope and post screenshots and also the error you may get after trying this out.

View solution in original post

Hi @NiloferA ,

 

thank you for your reply and it works, I'm now one step closer to what I need!

 

is it possible that I add not only date but also time to the file name?

Hi @NiloferA ,

 

I tried this:

concat('-Print-Date-',FormatDateTime(utcNow(),'yyyy-MM-dd'),'-Time-',FormatDateTime(utcNow(),'hh-mm-tt'))

 and everything is ok now, looks like generate PDF action must use '-' to work and can't have empty space...

View solution in original post

Hello @Derek4 ,

That's great! 

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Top Solution Authors
Top Kudoed Authors
Users online (3,538)