cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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

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

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
Super User III
Super User III

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!



Super User III
Super User III

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




@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

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




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.

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

@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

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




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

@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




@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

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
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Microsoft Ignite

Microsoft Power Platform: 2021 Release Wave 1 Plan

Power Platform release plan for the 2021 release wave 1 describes all new features releasing from April through September 2021.

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (28,046)