PATCH A SharePoint Date & Time Column In Power Apps



Goal

Change the VacationStartDateTime column (Date & Time Type) from blank to 12/25/2020 9:30AM.


Input

Vacation Requests (SharePoint List)

IDEmployeeNameVacationStartDateTimeHours
1Matthew Devaney8


Patch Function Code
Patch( 'Vacation Requests', LookUp('Vacation Requests', ID=1), { VacationStartDateTime: Date(2020,12,25) + Time(9,30,0) } )Code language: JavaScript (javascript)


Output

Vacation Requests (SharePoint List)

IDEmployeeNameVacationStartDateTimeHours
1Matthew Devaney12/25/2020 9:30AM8




Scenario #1: Date & Time Picker

Patch a value found in a date & time picker to a Date & Time field.



Patch Function Code
Patch( 'Vacation Requests', LookUp('Vacation Requests', ID=1), { VacationStartDateTime: DatePicker_VacationDate.SelectedDate + Time( Value(Dropdown_Hours.Selected.Value), Value(Dropdown_Minutes.Selected.Value), 0 ) } )Code language: JavaScript (javascript)