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

Saving file to SPO with date received

Hi everyone,

 

I have been build a flow to save documents received by e-mail to SPO document folder.

Part of the adds the date and time the file was received to the begining of the file name.

 

psa.PNG

The date and time format is "YYYYMMDD-HHmmss_, the problem is with the month. Did not think there was 38 months in a year? The received file was received today, 20190115, hence this is what I am expecting.

 

the code to create the file name is: 

concat(formatdatetime(addHours(triggerBody()?['DateTimeReceived'],0),'yyyymmdd-HHmmss_'),item()?['Name'])

 

If someone is able to advise what I am doing wrong I would greatly appreciate it.

 

Regards & Thanks

Tony

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Super User III
Super User III

@tonydown:

 

I believe that if you change mm in your expression to MM that you will get your expected results:

concat(formatdatetime(addHours(body('Get_email')?['DateTimeReceived'],0),'yyyyMMdd-HHmmss_'),item()?['Name'])
 
If this addresses your issue, please mark your post as solved.
 
Scott
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

View solution in original post

Highlighted
Community Support
Community Support

Hi @tonydown,

 

The expression of month is "MM" not "mm".

 

Please modify the expression as below:

concat(formatdatetime(addHours(triggerBody()?['DateTimeReceived'],0),'yyyyMMdd-HHmmss_'),item()?['Name'])

And the same as @ScottShearer.

 

Best regrads,

Alice

View solution in original post

3 REPLIES 3
Highlighted
Super User III
Super User III

@tonydown:

 

I believe that if you change mm in your expression to MM that you will get your expected results:

concat(formatdatetime(addHours(body('Get_email')?['DateTimeReceived'],0),'yyyyMMdd-HHmmss_'),item()?['Name'])
 
If this addresses your issue, please mark your post as solved.
 
Scott
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

View solution in original post

Highlighted
Community Support
Community Support

Hi @tonydown,

 

The expression of month is "MM" not "mm".

 

Please modify the expression as below:

concat(formatdatetime(addHours(triggerBody()?['DateTimeReceived'],0),'yyyyMMdd-HHmmss_'),item()?['Name'])

And the same as @ScottShearer.

 

Best regrads,

Alice

View solution in original post

Highlighted

Hi Scott,

 

Thanks very much, this seems to have solved the problem.

 

Regards

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Users online (9,504)