jwCbank
Scholar

Date value changes from Workflow into Task Form?

Jump to solution

Hello, 

 

I have a component workflow that takes a date/datetime value from Salesforce and enters the date into a task form. The date in the form is different than the date in the workflow, and I am wondering how I can fix that.

 

Example: In the workflow, if I use log to instance details, I can see that the date value is for example "2020-05-05." (May 5th, 2020). However, in the task form, this date will appear on a date form field as May 4th, 2020. And if I show the time on the form control, it will be May 4th, 2020 6:00pm. 

2 screenshots:

jwCbank_1-1597769825610.png

 

jwCbank_0-1597769801573.png

 

0 Kudos
Reply
3 Replies
SimonMuntz
Nintex How-To Center Expert
Nintex How-To Center Expert

Re: Date value changes from Workflow into Task Form?

Jump to solution
Hi,

Dates can always be tricky in SharePoint.
I assume your timezone is GMT -6 based on this output.
SharePoint is assuming the date that is retreived from Salesforce is GMT so when it adds to SharePoint it makes the adjustment.
Running the Salesforce date through a calculate date action before use may resolve this issue.
Reply
butlerj
Community Manager
Community Manager

Re: Date value changes from Workflow into Task Form?

Jump to solution

@jwCbank yeah that's pretty weird. I have to assume it has to do with the date data being pulled and somehow converted to UTC and then trying to do some auto adjustment based on server time, but...not 100% sure without doing a comparison of your SFDC environment and where you're located. 

 

You should be able to work around this with a two step process.

1. Leverage the 'Format date to string' action to ensure that the date variable is held in your local timezone (or forced to UTC)

DatetoString.png

 

2. Within your task form use the 'convertToDate' function to convert your txt variable back into a date as the default value:

Insert.png

 

Let me know if that helps!

0 Kudos
Reply
jwCbank
Scholar

Re: Date value changes from Workflow into Task Form?

Jump to solution

Thank you for the explanations and responses @SimonMuntz and @butlerj 

I did find it easiest to just run the date through a calculation, and just used a form rule to perform that. From my testing it seems to solve the issue perfectly. 

Reply