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

Date and time stamp for renaming an attachment and saving into dropbox

I have duplicated a flow that was shared on this forum that saves an attachment into a specified folder location on dropbox

 

It looks like this

 

Capture.JPG

 

The expression used in compose is 

 

concat(formatdatetime(triggerBody()?['DateTimeReceived'],'yyyy-MM-dd-hhmm - '),item()?['Name'])

This works perfect for us and creates the file as asked however all Flow procedures work in UTC timezone which makes the file name false, bhind by 9 hours

 

I need to add this code below somewhere to make the file create with the correct date and time stamp

addhours(utcnow(),9
1 ACCEPTED SOLUTION

Accepted Solutions
v-yuazh-msft
Community Support
Community Support

Hi @ Flowhelpplease,

I would offer you two methods to solve your problems.

 

Method 1:

You could modify the expression in compose as below:

concat(formatdatetime(addHours(triggerBody()?['DateTimeReceived'],9),'yyyy-MM-dd-hhmm - '),item()?['Name'])

 

Image reference:

 1.png

When an email with attachment arrives, the flow would run successfully as below:

 2.png

 

Method 2:

You could add a “Convert time zone” to convert the UTC time zone to your destination’s time zone as screenshots below:

3.png

 

Note:

  1. The Base time field of the “Convert time zone”action choose the “Received Time” dynamic content of the trigger, choose the “(UTC) Coordinated Universal Time” in the “Source time zone” field, choose your destination’s time zone in the “Source time zone” field, fill in the Formate string field as my expressions.
  2. Fill in the expressions in the Compose field as below:

concat(body('Convert_time_zone'),item()?['Name'])

 

When an email with attachment arrives, the flow would run successfully as below:

 4.png

 

 

Regards,
Alice Zhang

View solution in original post

3 REPLIES 3
v-yuazh-msft
Community Support
Community Support

Hi @ Flowhelpplease,

I would offer you two methods to solve your problems.

 

Method 1:

You could modify the expression in compose as below:

concat(formatdatetime(addHours(triggerBody()?['DateTimeReceived'],9),'yyyy-MM-dd-hhmm - '),item()?['Name'])

 

Image reference:

 1.png

When an email with attachment arrives, the flow would run successfully as below:

 2.png

 

Method 2:

You could add a “Convert time zone” to convert the UTC time zone to your destination’s time zone as screenshots below:

3.png

 

Note:

  1. The Base time field of the “Convert time zone”action choose the “Received Time” dynamic content of the trigger, choose the “(UTC) Coordinated Universal Time” in the “Source time zone” field, choose your destination’s time zone in the “Source time zone” field, fill in the Formate string field as my expressions.
  2. Fill in the expressions in the Compose field as below:

concat(body('Convert_time_zone'),item()?['Name'])

 

When an email with attachment arrives, the flow would run successfully as below:

 4.png

 

 

Regards,
Alice Zhang

View solution in original post

Perfect, thank you Alice!!

Thanks a lot 🙂 your Solution worked a great to me

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.

Users online (3,082)