Skip to main content
All CollectionsFAQsBuilding πŸ‘·β€β™‚οΈ
How to Correctly Display Date/Time Fields from SharePoint Lists in Team Forms
How to Correctly Display Date/Time Fields from SharePoint Lists in Team Forms
Updated over 3 weeks ago

When using the datasources feature with a SharePoint list containing Date/time columns you may notice that the date in the drop-down menu may not match what you see when viewing the list in SharePoint. This happens because SharePoint stores all date/time fields in UTC but displays the date in the timezone that is configured in the SharePoint sites settings. Team Forms on the other hand receives this UTC date form SharePoint and does not automatically convert this to any specific timezone. You will need to do this manually using the steps below.

  1. Drag and drop the SharePoint data component into your form and link it to the SharePoint list containing the date column

  2. Under the data tab update the "Label Property" to "πŸ› οΈ Custom". This will allow us customise what appears in each item of the drop-down menu

  3. An "Item Template" property will appear that will allow you to add custom HTML to specific what should appear in the drop down menu. We will use curly bracket syntax to inject Javascript in the html to convert the UTC date to the users local time zone using the expression below.

<span>{{ moment(item.DateCol).format('DD-MM-YYYY HH:mm') }}</span>

Did this answer your question?