Goal
Change the VacationStartDateTime column (Date & Time Type) from blank to 12/25/2020 9:30AM.
Input
Vacation Requests (SharePoint List)
| ID | EmployeeName | VacationStartDateTime | Hours |
| 1 | Matthew Devaney | 8 |
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)
| ID | EmployeeName | VacationStartDateTime | Hours |
| 1 | Matthew Devaney | 12/25/2020 9:30AM | 8 |
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) Did You Enjoy This Article? 😺
Subscribe to get new Copilot Studio articles sent to your inbox each week for FREE