Rizi
Design Dabbler

Saving Date value to SharePoint Online list

Jump to solution

Hi,

I have an NWC form with a Date only field (Date of Birth) and using SharePoint Create an Item action to send its value to SharePoint. I'm directly mapping the list field to the form Date of Birth Variable. The list field is a Date Only field.

When the item is created in SharePoint the date value is always a day behind. i.e. when I select 01/06/2021 as the date in the NWC form, it shows up in the list as 31/05/2021.

I'm guessing this is because the Time Zone is coming into play. How do I set the date correctly in the workflow so the list item shows the same date as in the form.

The regional settings in both form and the list is set to UTC+08:00 Perth

 

Thanks!

Labels: (1)
0 Kudos
Reply
6 Replies
JRoberts
Moderator
Moderator

Re: Saving Date value to SharePoint Online list

Jump to solution
Hi Rizi,

I know you mentioned that the regional settings on the list are at UTC+8:00. Do you have the administrator level to check your personal regional settings as well as the SharePoint Tenant's overall settings? Perhaps those aren't aligned correctly. The following link steps through a couple of those settings.

https://www.spguides.com/sharepoint-online-regional-settings/

Jason
0 Kudos
Reply
Rizi
Design Dabbler

Re: Saving Date value to SharePoint Online list

Jump to solution

Hi Jason,

The form is set up so anyone can access it using it (public anonymous access). So my personal regional settings should not be an issue. But I've checked both mine and the account the data connection is using to connect to SharePoint online: Both have the correct regional settings (UTC+8:00). The Same for the Site collection the list is on and in the NWC Form settings.

The tenant regional settings should not affect at all correct? as it's been overridden by the Site COllection Regional settings?

0 Kudos
Reply
leighburke
Nintex Employee
Nintex Employee

Re: Saving Date value to SharePoint Online list

Jump to solution

@Rizi Date fields are always passed as a UTC date/time and SharePoint date only fields still have time component that is just hidden on the view. You can use a log to instance detail to see the time being passed. The screenshot below shows the UTC time as well it being converted both US and an Aus timezone using the convert date to string action.

leighburke_1-1623882970821.png

It could be the users personal regional settings causing the issue(https://support.microsoft.com/en-us/office/change-your-personal-language-and-region-settings-caa1fcc...). The other option is converting the date to a timezone and putting in a text field or using the add time to date if you can't resolve the regional setting.

 

Reply
Nintex_Andrea
Moderator
Moderator

Re: Saving Date value to SharePoint Online list

Jump to solution

Hi @Rizi ,

I was able to get this to work in my test environment by doing the following:

  1. First I checked the Create an item action to see if it would accept a text variable to set a date column in the list and it does. 😀
  2. Next, I manually inserted a date in the Create an item action to see what date format is required:
    Nintex_Andrea_0-1623936562332.png
  3. Now that I knew what format is required, I added a Format date to string action to my workflow above the Create an item action and stored the formatted date in a text variable named txtDOB. This also allows me to specify a time zone. 
    Nintex_Andrea_1-1623936707600.png
  4. Because the exact format option I needed wasn't available, I also added a Create a text string action to finalize the formatting:
    Nintex_Andrea_2-1623936809556.png
  5. Finally, in my Create an item action, I inserted the txtDOB variable into the DOB date column field:
    Nintex_Andrea_3-1623936922309.png
  6. The completed workflow looks like this:
    Nintex_Andrea_4-1623936963690.png

    This corrected the date in my SharePoint Online list. Give it a try and see if it works for you.

0 Kudos
Reply
JRoberts
Moderator
Moderator

Re: Saving Date value to SharePoint Online list

Jump to solution

I was also able to reproduce the issue.

 

One thing that worked for me was to change the date format of the Date and Time column in SharePoint to  Date & Time under the Additional Column Settings section.

 

JRoberts_0-1623939508277.png

 

I also configured the date control on the NWC form to turn off the Hide Time setting.

JRoberts_1-1623939617897.png

 

I think this way the date time format comes in from the NWC form with the full date and time based on when the date was selected then SharePoint can store it with the correct UTC value. Ultimately, you may need to ensure that you have the time designated with the date as it gets stored in SharePoint.

0 Kudos
Reply
Rizi
Design Dabbler

Re: Saving Date value to SharePoint Online list

Jump to solution

This was a Bug in NWC. Opened a Support Case with Nintex Support and they have applied a fix for it. All working as expected now.

 

Thank you for all your help 😊

View solution in original post

0 Kudos
Reply