In this blog, we are going to see how to use the patch function to update a SharePoint Date & Time column in Power Apps.
In a SharePoint list we have a column RequestDateTime, our goal is to update a RequestDateTime (Date & Time type) from Blank to 12/12/2022 10:47 AM.
Input
Meeting Request (SharePoint List).
ID |
RequestedBy |
RequestDateTime |
1 |
Ravishankar N |
Patch Function Code
Patch('Meeting Request', LookUp('Meeting Request', ID = 1), {
RequestDateTime: Date(2022, 12, 12) + Time(10, 47, 0)
})
Output
Meeting Request (SharePoint List).
ID |
RequestedBy |
RequestDateTime |
1 |
Ravishankar N |
12/12/2022 10:47AM |
There is another way to Patch a value from Date Time picker to a Date & Time type.
Patch Function Code
Patch('Meeting Request', LookUp('Meeting Request', ID = 1), {
RequestDateTime: (DateValue(dp_requested_date.SelectedDate) + txt_RequestTime.Text)
})
That’s it, you have seen how to use the patch function to update a SharePoint Date & Time column in Power Apps. Feel free to fill up the comment box below if you need any further assistance