cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Flostradamus
New Member

Date formatted incorrectly when creating item in SharePoint list

I have seen quite a few posts regarding the time/UTC issue with flow, but can't find anything about the issue I am having.

 

I have a flow that sends an adaptive card to a user in Teams and waits for a response. When the user responds, an item is created in a SharePoint list. The flow works perfectly. No issue there. The issue is the date format. In the output of 'Post an Adaptive Card to a Teams user and wait for a response', the date is formatted 'yyyy-MM-dd'. I use this value in a 'Set variable' action (type: 'string') and wrap it in a formatDateTime expression- formatDateTime(outputs('Post_an_Adaptive_Card_to_a_Teams_user_and_wait_for_a_response)?['date'],'MM-dd-yyyy'). The outputs of this action show the date in 'MM-dd-yyyy' format. I then use this variable (selected from dynamic content) when creating the item in SP. When reviewing the flow, the inputs for the 'Create item' action correctly show the date as 'MM-dd-yyyy'. However, the outputs show 'yyyy-MM-dd', which I have confirmed is displayed in the SP list itself. I have included screenshots below of all actions referenced and the inputs & outputs of those actions.

 

The adaptive card used an 'Input.Date' type field. The SP column was originally a date column. However, the flow kept failing due to the variable being of type 'string', so I changed the column type to "Single line of text'. Will probably just create a calculated column in SharePoint that references the single line text column and formats the value.

 

This seems to be a SharePoint issue rather than PA. Has anyone else experienced this? Has MS or someone from the PA team acknowledged the issue? Any help is greatly appreciated! Thanks! 

 

Inputs & outputs of 'Set Variable' actionInputs & outputs of 'Set Variable' actionItem in SharePoint listItem in SharePoint listOutputs from adaptive card sent using Teams connectorOutputs from adaptive card sent using Teams connectorOutputs from 'Create item' actionOutputs from 'Create item' actionInputs from 'Create item' actionInputs from 'Create item' action

1 REPLY 1
rrovira
Microsoft
Microsoft

Hello, @Flostradamus

 

Yes, it could be something in the configuration of your SharePoint site. I've seen some blogs detailing how to change the date format of your SharePoint lists (you must be the Administrator of that site). 

 

Here's one example of said blogs: Changing Date Format in SharePoint - Konnectogrow

 

The how you access the regional configuration of a site has changed a little bit, so I'll post some picture below:

 

1. Click the gear icon (top right of your screen) inside the site you want to configure. 

rrovira_1-1619814810113.png

 

2. Click on "site information".

 

rrovira_0-1619814627544.png 

3. Select the option "View all site settings"

rrovira_2-1619814945929.png

4. Here you'll find the "Regional settings"

rrovira_3-1619815064342.png

Let me know if changing the regional configuration changes how the date is shown! 

 

Cheers, 

Rodrigo! 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (1,283)