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 / Textinput date time fo...
Power Apps
Unanswered

Textinput date time format to datetime format

(0) ShareShare
ReportReport
Posted on by 19

Hi,

 

I am creating a new power apps, in one field users are copy and past the date time data(ex: 2023/01/27 10:30 AM), data type for this field as singlelinetext. We are using multiple copy paste date options, so we can't use datepicker.

I am using the submitform option to store the data in SharePoint list.

Before saving the data to SharePoint list, needs to change the datetime format data type single line text to date time.

Please some one help.

Categories:
I have the same question (0)
  • Muhanned Profile Picture
    on at

    Hi @Nikilp ,

     

    You can use the Text function to convert the single line text data to a date and time format. The Text function takes a date/time value and converts it to a string in a specified format.

    For example, you can use the following formula to convert the single line text data to a date and time format and then submit it to a SharePoint list:

    First, you'll need to create a variable to store the date and time data in the correct format:

    Set(varDateTime, DateTimeValue(FieldName.Text))

    Where FieldName is the name of the field that contains the single line text data, "yyyy/mm/dd hh:mm AM/PM" is the format you want the date and time to be displayed in, and Value() will convert the text to a number if it is a date format.

    Next, you'll need to use the SubmitForm function to submit the data to the SharePoint list and use the variable to update the SharePoint list field for the date and time:

    SubmitForm(CanvasForm); Patch(SharePointList, CanvasForm.LastSubmit, {DateTimeField: varDateTime});

    Note that you will need to replace below:
    "FieldName" with the actual name of the field that contains the single line text data,
    "CanvasForm" with the name of the form that you are submitting,
    "SharePointList" with the name of the SharePoint list that you are updating,
    "DateTimeField" with the name of the date/time field in the SharePoint list.

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 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard