cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
logixcrm
Helper I
Helper I

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

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..

 

1 ACCEPTED SOLUTION

Accepted Solutions

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


Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials

View solution in original post

4 REPLIES 4
abm
Super User
Super User

Hi @logixcrm 

 

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

 

image.png



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials

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

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


Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials

View solution in original post

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

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Users online (3,099)