Skip to main content

Notifications

Community site session details

Community site session details

Session Id : 5xXT3+lYPaFraZbnvIBOOx
Power Automate - Building Flows
Answered

When getting the date from Dynamics, the date is 1 day behind

Like (0) ShareShare
ReportReport
Posted on 2 Jan 2020 14:04:33 by 71

Good Day Community,

 

I have created a Flow that has a DELAY UNTIL step which is supposed to delay until a specific date which is displayed within the Dynamics 365 form - the issue is that when I add the date dynamically to the DELAY UNTIL step, the date is 1 day behind the date in Dynamics 365. (😕)

 

This is what the field looks like in Dynamics 365

Flow response 1.JPG

 

As you can see below, the date I am receiving back is 1 day behind.

Flow Response.JPG

 

I need to know what expression I can enter to force this date to the right date, in fact I need the date to be 2020-01-06T23:5900Z so that this date can essentially be used as an expiry time.

 

Below is what is currently in the Delay Until field.

Flow response 2.JPG

 

You help will be greatly appreciated..

 

  • logixcrm Profile Picture
    71 on 02 Jan 2020 at 16:06:34
    Re: When getting the date from Dynamics, the date is 1 day behind

    Finally I got it!

     

    Thank you @abm your advice provided part of the solution.

     

    Here is the final solution...

     

    Firstly, map the date field from Dynamics 365 into the compose action

    step 1.JPG

     

    Next, use the convert time zone action to get the date into the correct format, make sure to set the base time as the output from the compose step.

    Step 2.JPG

     

    Finally, you now need to compose an expression to add 1 day. here is the expression i used.

    addDays(body('Convert_time_zone'), 1, 'yyyy-MM-dd')
     
    The only issue here is that you have essentially undone the time formatting, however, this is an easy fix. After entering the expression, click on OK, then next to expression, add a time, in my case i need to time to be 5pm so I added T17:00Z
    Step 3.JPG
     
    That's it, save and test the flow and you should get the following result;
     
    Date value retrieved from Dynamics 365
    Step 4.JPG

     

    The result of the time conversion

    Step 5.JPG

     

    Finally the result of the delay until action, you will see 1 day has been added and the time set to 5pm

    Step 6.JPG

     

  • Verified answer
    abm abm Profile Picture
    32,464 Most Valuable Professional on 02 Jan 2020 at 16:00:09
    Re: When getting the date from Dynamics, the date is 1 day behind

    Hi @logixcrm 

     

    Thanks for your quick reply.

     

    Please follow the below steps:

     

    image.png

     

    The expression I used is as follows:

     
    formatDateTime(variables('CRMDate'),'yyyy-MM-ddT23:59:00Z')
     
    Here is my test result
     
    image.png
     
    If you need any further help please let me know.
     
    Thanks
  • logixcrm Profile Picture
    71 on 02 Jan 2020 at 15:39:20
    Re: When getting the date from Dynamics, the date is 1 day behind

    Thank you for the feedback, however, the output returns the same value as the input even if I set the output to +3 or +4

     

    time zone.JPG

  • abm abm Profile Picture
    32,464 Most Valuable Professional on 02 Jan 2020 at 15:13:52
    Re: When getting the date from Dynamics, the date is 1 day behind

    Hi @logixcrm 

     

    Try using action Convert Time Zone. Set the right destination time.

     

    image.png

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - Building Flows

#1
Churchy Profile Picture

Churchy 6

#2
Chriddle Profile Picture

Chriddle 4 Super User 2025 Season 1

#2
stampcoin Profile Picture

stampcoin 4

Overall leaderboard
Loading started