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
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Users online (86,251)