cancel
Showing results for 
Search instead for 
Did you mean: 
Automation Master
Automation Master

Date field "losing a day" when creating item

Hello Fellow Nintexperts,

While working with a client today, I've come across an interesting issue. Despite developing a work-around already, I'd love to get some insight from the community to better understand my finding or to surface this bug. In order to confirm this issue wasn't unique to my client's environment, I recreated the issue in my development environment as well (see below).

I have two SharePoint Lists:

  • TEST A
  • TEST B

Both of these Lists have a date column called Some Date configured with the default settings (Date Only). I am then using a Site Workflow to fetch the Some Date value from a single item in the TEST A list, setting this value to a workflow variable (configured as a date), and am then creating a new item in the TEST B list based on this value.

What I'm finding is that when taking this route, the date stored in the second list loses a day (see screenshots below).

Query List > Set Variable > Create Item using variable

Any ideas on what would cause this behavior? I suspect it has to do with how time is being handled with converting from item value to variable and back to a list item value, but it threw me for a loop.

As silly as it sounds, I worked around the problem by adding a Calculate Date action before the Create Item action is called. It doesn't actually do anything. It simply adds zero time and stores the value back as the original variable:

After doing this, the correct date is shared to the new item. Any ideas?

Environment Details:

Nintex Workflow for SP2013 (version 3.2.3.2).

Labels: (2)
Reply
18 Replies
Automation Master
Automation Master

Re: Date field "losing a day" when creating item

Just wanted to check back in here – anyone run into a similar situation?

0 Kudos
Reply
Automation Master
Automation Master

Re: Date field "losing a day" when creating item

Hey just been looking at this for you.  I got the exact same dates but I did the workflow slightly differently - what do you think?

Reply
Highlighted
Automation Master
Automation Master

Re: Date field "losing a day" when creating item

Thanks for taking a look Cassy Freeman‌! It's one of those situations where I was able to work-around/resolve the bug a number of different ways, but I believe it's a bug nonetheless.

In fact, if I had designed this workflow myself, I doubt I would have taken the path that led to the strange behavior in the first place. I really just wanted to expose it in case it's something worth lobbing into the dev team's backlog.

Reply
Automation Master
Automation Master

Re: Date field "losing a day" when creating item

oh ok hold on I just changed the workflow to:

  1. query list a for one item and pull Some Date into text variable vTextSomeDate
  2. used Set Variable to set date variable vDateSomeDate = vTextSomeDate
  3. Created item in list B using vDateSomeDate

is that the same as your scenario?

The date was the same.  It didn't add a day.  Let me know if I have got it wrong so that we can see if this is a bug.

0 Kudos
Reply
Automation Master
Automation Master

Re: Date field "losing a day" when creating item

Sure Cassy Freeman‌ no problem! Here's my workflow if you'd like to download and take a look:

https://nintexassets.blob.core.windows.net/wfs/New_Workflow.nwf 

It's really just two actions – Query List and a Create item:

To keep the test-case simple, my Query List action is filtered by the first item in the TEST A list (i.e. ID = 1). Here's that action's configuration:

myDate is simply a Date and Time variable:

After I've pulled the date into this variable, I am simply creating an item in the TEST B list (see configuration below):

0 Kudos
Reply
Automation Master
Automation Master

Re: Date field "losing a day" when creating item

ok finally have the same as you - and the date works fine.

But maybe it's because our dates are different to yours i.e. dd/mm/yyyy?

Reply
Automation Master
Automation Master

Re: Date field "losing a day" when creating item

Haha so you're telling me it's a #MURICA problem eh?

Reply
Automation Master
Automation Master

Re: Date field "losing a day" when creating item

hahahahahahahahahahahahahaha yup!

0 Kudos
Reply
Automation Master
Automation Master

Re: Date field "losing a day" when creating item

Hello

Not sure if this was addressed, but are you two running the same exact versions of workflow?    (those pesky little version numbers...).

Could be a bug, or it could be that you are setting a default value somewhere and its just appearing as a bug - the date isn't updating from its original value.   If you disable the workflow and create the item, what value is in the date for that item?    

0 Kudos
Reply