cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Toucan
Level: Powered On

More date problems with Sharepoint

I know this is a common topic in the flow forums, but it's driving me to drink.

I'm trying to create an approval workflow in sharepoint for time off for my company. I've set it up in a standard way such that when a user creates a new item I use flow to send an email to an approver who then says yes or no, with the aim that the status of the request goes from Pending to approved or rejected. 

 

I know that flow has issues dealing with timezones but I thought I was one of the lucky ones since I do work in UTC.

 

However, when dates are going to flow I get the result that a day is taken off. By changing the sharepoint column type to date and time I can see that Flow is taking off an hour (daylight savings?) which means a day is taken off when only the date (not time) format is used.

 

When the approval goes through and the sharepoint item is updated, another day is taken off the times. By changing to date & time format I can see flow is now removing a further 7hr (pacific time zone?).

 

I've tried various workarounds. Changing my sharepoint time zone will fix the first one - but I don't really want to do that.
For the update of the sharepoint item I've tried with no success various varieties of adddays or addhours function but none work.
For example when I have the update sharepoint item field set to...

adddays(<Start date>, 1, 'yyyy-MM-dd')

the flow doesn't work and I get the error message:

 "status": 502, "message": "The string was not recognized as a valid DateTime. There is an unknown word starting at index 0."

 

Any ideas on this would be most welcome.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: More date problems with Sharepoint

Hi Toucan,

 

So far in flow, the Workflow Definition Language supports in the advanced mode in condition, but it won't work in the action fields. That is why your sharepoint item field has the error. 

 

I have found an idea submitted by other users where you can vote on it so that it might be considered in the future release:

https://powerusers.microsoft.com/t5/Flow-Ideas/Invoke-functions-from-Action-Blocks/idc-p/2883#M91

 

Regards,

Mona

Community Support Team _ Mona Li
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
Toucan
Level: Powered On

Re: More date problems with Sharepoint

My best workaround for this is to create a bunch of calculated columns in Sharepoint to account for the offset. It also seems to help a bit if you pass string versions of dates to flow and then can allow for a change in dates in the approval emails.

Community Support Team
Community Support Team

Re: More date problems with Sharepoint

Hi Toucan,

 

So far in flow, the Workflow Definition Language supports in the advanced mode in condition, but it won't work in the action fields. That is why your sharepoint item field has the error. 

 

I have found an idea submitted by other users where you can vote on it so that it might be considered in the future release:

https://powerusers.microsoft.com/t5/Flow-Ideas/Invoke-functions-from-Action-Blocks/idc-p/2883#M91

 

Regards,

Mona

Community Support Team _ Mona Li
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

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (4,968)