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

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
Highlighted
Community Support
Community Support

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
Highlighted
Frequent Visitor

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.

Highlighted
Community Support
Community Support

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
firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

Top Solution Authors
Users online (7,258)