cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TorreyFalconer
Helper IV
Helper IV

Patch Text input to Date field on Edit form

Hello hello

 

So I would like to use a text input box in Powerapps to update a date column in Sharepoint. I realize this sounds silly, but it is just ideal for us. However I cannot seem to get the Patch expression to be able to accomplish this. Any tips? I tried this:

 

Patch(
'Vehicle Hold Times',
ThisItem,
{'Time IN': 'Textinput_TimeIN'.Text}
)

 

1 ACCEPTED SOLUTION

Accepted Solutions

Try something like this:

Patch(
'Vehicle Hold Times',
ThisItem,
{'Time IN': DateValue('Textinput_TimeIN'.Text)}
)

Let me know if this helps.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

Hardit Bhatia
https://thepoweraddict.com

View solution in original post

5 REPLIES 5
PowerAddict
Super User
Super User

Hi,

You can use the DateValue function to convert a string to date.

Some more info:
The DateValue function converts a date string (for example, "10/01/2014") to a date/time value.

The TimeValue function converts a time string (for example, "12:15 PM") to a date/time value.

The DateTimeValue functions converts a date and time string (for example, "January 10, 2013 12:13 AM") to a date/time value.

More details can be found here: https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-datevalue-timevalue

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

Hardit Bhatia
https://thepoweraddict.com

@PowerAddict  thanks, but how do I use this with the Patch function??

Try something like this:

Patch(
'Vehicle Hold Times',
ThisItem,
{'Time IN': DateValue('Textinput_TimeIN'.Text)}
)

Let me know if this helps.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

Hardit Bhatia
https://thepoweraddict.com

Glad I could help! Good luck with the rest of your app! Feel free to reach out in case of any questions!

Thanks,
Hardit Bhatia
The Power Addict
https://thepoweraddict.com
RatanKP
Helper I
Helper I

Am facing a serious problem with DateValue('Textinput_TimeIN'.Text), as per my SQL Table the Data is in "YYYY-MM-DD" format and when I fetch the data from SQL to Powerapps am receiving the Values as "MM/DD/YYYY"(may be due to SQL Server Sytem Date configuration) and I used Text function to convert to "YYYY/MM/DD" and when am passing the value to date field I got text Conversion error and I used DateValue to convert Text to Date Format and  system is converting the DateFormat automatically to "MM/DD/YYYY", I want to convert the Text to DateFormat in "YYYY/MM/DD" Format, any Suggestions would be appreciated.

 

Thank you in advance for all.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,849)