cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

The date is a day off when a vacation request is approved

I finally got my flow to add a new calendar (event list) item when a vacation request is approved. But it is off by a day.  I am using an existing calendar that was used using SPD workflow and it worked fine.  Now I'm using a PowerApps form with Flow on the same calendar, not sure if that is significant.  Is there a timezone setting that I should be using in PowerApps?

 

create-item-pto.png

 

sp-request-list.png

calendar-event.png

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Super User III
Super User III

Re: The date is a day off when a vacation request is approved

Hello @RobertC71 

 

So is the issue still your date being a day off?

 

You do not need the Convert time zone action.

 

What you need to do is use the expression like you are doing but pass the date you are getting from Power Apps

 

convertToUtc( <Put your Power Apps date here> ,'Pacific Standard Time')

 

Also you can get rid of the 'g' at the end

 

pic1.png

 

—Josh
If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others





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

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips, tricks, and guides
FlowAltDelete




View solution in original post

Highlighted
Super User III
Super User III

Re: The date is a day off when a vacation request is approved

Hi @RobertC71

So if I get this correct. The end date is a day early? If yes
Can you try to use the expression:
addDays()
On the end date.

Example:
addDays('<your endDate>', 1)

—Josh
If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others




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

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips, tricks, and guides
FlowAltDelete




View solution in original post

12 REPLIES 12
Highlighted
Dual Super User III
Dual Super User III

Re: The date is a day off when a vacation request is approved

Hi!
My suggestion: inspect powerapps date outputs in flow (you can use a dummy Compose action block), verify which timezone reference they bring.
Then use Convert Time Zone to manipulate them according to your needs. Use its outputs to create the item
This approach is better described here
https://powerusers.microsoft.com/t5/Building-Power-Apps/Setting-PowerApps-time-zone/td-p/258263

Hope this helps


Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Highlighted
Super User III
Super User III

Re: The date is a day off when a vacation request is approved

Hi @RobertC71

I have had the same issue when passing dates from power apps to flow. I believe this is from the date being in UTC.

Anyway this is the expression I used:
convertToUtc('<TIMESTAMP>','<SOURCETIMEZONE>')
Time stamp = the date you need to convert. In your case it is the PowerApps value.

Source time zone = find your local time zone from the site below.

For time zones that are available check:
https://support.microsoft.com/en-us/help/973627/microsoft-time-zone-index-values

—Josh
If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others</SOURCETIMEZONE></TIMESTAMP>




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

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips, tricks, and guides
FlowAltDelete




Highlighted
Frequent Visitor

Re: The date is a day off when a vacation request is approved

@Jcook Thanks for your reply.  I'm still having issues, maybe the issue is with my flow.  I've attached screenshots.

 

pto-fullflow.pngpto-converttoutc.pngpto-converttimezone.pngpto-createitem.png

Highlighted
Super User III
Super User III

Re: The date is a day off when a vacation request is approved

Hi @RobertC71 

I cannot see your expression.

 

Can you copy the expression and add a comment to the action it belongs to or paste it in here

 

—Josh
If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others





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

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips, tricks, and guides
FlowAltDelete




Highlighted
Frequent Visitor

Re: The date is a day off when a vacation request is approved

My apologies here it is:

convertToUtc(triggerBody()['Sendemailwithoptions_Body_1'],'Pacific Standard Time','g')

 

It is in compose and compose3 actions.  Replacing Sendemailwithoptions_Body_1 with Sendemailwithoptions_Body_2 in compose3.

Highlighted
Super User III
Super User III

Re: The date is a day off when a vacation request is approved

Hello @RobertC71 

 

So is the issue still your date being a day off?

 

You do not need the Convert time zone action.

 

What you need to do is use the expression like you are doing but pass the date you are getting from Power Apps

 

convertToUtc( <Put your Power Apps date here> ,'Pacific Standard Time')

 

Also you can get rid of the 'g' at the end

 

pic1.png

 

—Josh
If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others





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

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips, tricks, and guides
FlowAltDelete




View solution in original post

Highlighted
Frequent Visitor

Re: The date is a day off when a vacation request is approved

@Jcook The calendar was almost correct.  I created an entry in PowerApps startdate 5/14/2020 enddate 5/18/2020, the calendar entry end the pto request at 5/18/2020 12:00 AM instead of the full day for 5/18.  Shown in screenshot.  And the SP list shows the requested dates in UTC instead of PST.  What else could be wrong?  Thanks again.Snag_850102.pngSnag_853419.png

Highlighted
Super User III
Super User III

Re: The date is a day off when a vacation request is approved

Hi,

What is your SharePoint list data type?
Check in SharePoint if the value is allowing date and date+time.

—Josh
If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others




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

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips, tricks, and guides
FlowAltDelete




Highlighted
Frequent Visitor

Re: The date is a day off when a vacation request is approved

Hey Sir,

 

My start and end dates are Date Only.  I was able to get the update item fixed, needed to add the output of the converttoutc in those fields.  Only one issue left.  The calendar doesn't show the end date as part of the pto request because the time is still set to 12AM.  You help has been tremendous.  Thanks

Highlighted
Super User III
Super User III

Re: The date is a day off when a vacation request is approved

@RobertC71 

That is awesome!

 

Sorry I dont understand the last issue?

 

—Josh
If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others





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

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips, tricks, and guides
FlowAltDelete




Highlighted
Frequent Visitor

Re: The date is a day off when a vacation request is approved

@Jcook The last issue is the calendar isn't displaying the way I need it too.  I've included 2 screenshots.  How it's looking now and the 2nd screenshot is what it should look like if the time was set properly.

 

In this example the vacation request is from 5/14 - 5/18.  I need the calendar to show 5/14 through 5/18.  I hope this makes sense now.

pto-calendar-1.png

 

 

pto-calendar-2.png

Highlighted
Super User III
Super User III

Re: The date is a day off when a vacation request is approved

Hi @RobertC71

So if I get this correct. The end date is a day early? If yes
Can you try to use the expression:
addDays()
On the end date.

Example:
addDays('<your endDate>', 1)

—Josh
If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others




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

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips, tricks, and guides
FlowAltDelete




View solution in original post

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.

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (7,091)