web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / DataPicker and format ...
Power Apps
Suggested Answer

DataPicker and format date

(1) ShareShare
ReportReport
Posted on by 94
In a canvas app, I have a DataPicker, connected to a sharepoint list.
In the Format attribute of the DataPicker, I ‘ve put
“  If(Not IsBlank(DateValue3.SelectedDate); Date(Year(DateValue3.SelectedDate); Month(DateValue3.SelectedDate); Day(DateValue3.SelectedDate)))”

I put a text label, with Text function
“If(Not IsBlank(DateValue3.SelectedDate); Date(Year(DateValue3.SelectedDate); Month(DateValue3.SelectedDate); Day(DateValue3.SelectedDate)))”

I’m in Europe, so in the text label I see  2/01/2025  ( 2 january 2025), but in the datapicker I see “gio 2 gen 2025”.
When I insert the value in the form in the sharepoint list I have this error:
The string was not recognized as a valid dateTime.There is an unknow word starting at index1.

What can I do ? I think that the error depends on the different valorisation between dataPicker and sharepoint list (in this list if i insert a new record the data is in the format  dd/mm/yyyy).
Categories:
I have the same question (0)
  • Suggested answer
    Gopala_Krishna Profile Picture
    1,495 on at
    I think the issue is happening due to inconsistent date format while the data is being uploaded to SharePoint, kindly follow the shared steps to ensure a consistent date format
     
    Format the date in the text label by using the below shared formula
    Text(DateValue3.SelectedDate, "[$-en-US]dd/mm/yyyy")
     
    When saving the date to the SharePoint list, ensure it is in the correct format
     
    Patch(
        YourSharePointList,
        Defaults(YourSharePointList),
        {
            DateColumn: DateValue(Text(DateValue3.SelectedDate, "[$-en-US]yyyy-mm-dd"))
        }
    )
     
  • ancorte Profile Picture
    94 on at
    The problem is that when i use the Label and the text.value, the result in teh label itìs correct. I don't find a whey to change the format in the Datapicher: i dont'want that it contains the name od the day. I think that's the problem, because the format in sharepoint list is short (only date without the name of the day). 
  • timl Profile Picture
    36,393 Super User 2025 Season 2 on at
    Are you using a Form control and calling SubmitForm to save your record?
     
    If so, can you confirm that the Update property of the datacard is set to DateValue3.SelectedDate? It sounds like you might be converting this to text.
     
    The format of the date picker doesn't matter. Even if you see “gio 2 gen 2025”. the SelectedDate property returns a date object that should be recognised as a valid date, irrespective of the locale.
  • ancorte Profile Picture
    94 on at
    Yes i'm using a form control and so i use the SubmitForm to inser the data. And the Update property is selected to DataValue3.SelectedDate.
    The Update property of DataCard3 is : "
    If(Not IsBlank(DateValue3.SelectedDate); DateTime(Year(DateValue3.SelectedDate); Month(DateValue3.SelectedDate); Day(DateValue3.SelectedDate); Value(HourValue3.Selected.Value); Value(MinuteValue3.Selected.Value); Second(DateValue3.SelectedDate)))"
     
     
  • ancorte Profile Picture
    94 on at
    Sorry, i think to have understood where is the problem. The DataPicker functions in the right way. The problem is that in the same form i have another Data field that is not corrected linked to the field in the sharepoint list. To find the error, i used the monitoring, so after entered in the detailed of the messages I understood that the problem was differently. To be sure, i delete the second data field in the form, and all was ok. Thanks for your help !!  Now i try to resolve the problem of the second data field.
  • timl Profile Picture
    36,393 Super User 2025 Season 2 on at
    Thanks for the update ancorte. Let us know if you need any more help on this.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard