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

Can't create flow with proper dates on calendar

Hi,

 

I know this problem has come up probably 1000x but I still can't find a resolution that works for my case. I am trying to create a vacation/time off form. 

 

My flow follows this path:

  1. The user will fill out a sharepoint form embedded into a Teams tab. It includes 2 date fields for start and end dates. A dropdown box with a choice of reasons.
  2. Then it starts an approval process which sends an email for now to me (just for testing, eventually I'll add it so it recognizes the user's manager and sends to them)
  3. If rejected, it changes the status to rejected and sends an email to the user saying it was rejected.
  4. If approved, it changes the status to approved. It then creates an entry in a group calendar.
  5. It then sends an email to the user and CC's HR telling them it was approved and added to the calendar.

Clipboard02.jpg

The problem lies in the calendar part.

Since all date/time defaults to UTC and I'm in NY (Eastern time), it's adding the entry to the calendar 4 hours earlier. For example, if I put in a vacation request for Oct 5 to Oct 6, it's showing on the calendar as Oct 4 at 8pm to Oct 5 at 8pm.

 

Does anyone know what I could do to overcome that? I've been trying a bunch of things but can't get it to work properly, including converting time zone. Odd that time zone is not an option in Create item.

 

Thanks for any help you can offer.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Hi @wookietv,

 

Since UTC saves the time in Calendar for four hours earlier than the time the user submits, you could try to edit the start and end dates submitted by the user using the Expression---addHours() function.

For example, addHours(‘start date’, 4) will be saved in Calendar for the same time as the actual submission.

I did a test on my side, adding Dynamic content to addHours() plus the time difference. It work, as below:

30.PNG

When I submitted the time at 2018/10/10-2018/10/11, the correct time was recorded in Calendar:

31.PNG

Please take a try and let me know if issue still exist.

 

Best Regards,

Barry

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Highlighted
Community Support
Community Support

Hi @wookietv,

 

Since UTC saves the time in Calendar for four hours earlier than the time the user submits, you could try to edit the start and end dates submitted by the user using the Expression---addHours() function.

For example, addHours(‘start date’, 4) will be saved in Calendar for the same time as the actual submission.

I did a test on my side, adding Dynamic content to addHours() plus the time difference. It work, as below:

30.PNG

When I submitted the time at 2018/10/10-2018/10/11, the correct time was recorded in Calendar:

31.PNG

Please take a try and let me know if issue still exist.

 

Best Regards,

Barry

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Hi,

 

Thank you for the reply.

I tried what you suggested, and it is working quite a bit better.

I just wish it didn't use times at all and can be flagged as an all day event.

Submitting a form that has vacation start date and end date (for example October 17 start to October 19 end), the end date is being put at Oct 19th at midnight. So on the calendar, it shows only 17 and 18 as blocked off.

 

I guess a workaround is rephrasing the end date as "What day will you return?"

 

Thanks!

 

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.

Top Solution Authors
Top Kudoed Authors
Users online (9,644)