PATCH A SharePoint Yes/No Column In Power Apps



Goal

Change the Completed column (Number type) from No to Yes


Input

IT Helpdesk Tickets (SharePoint List)

IDDateDescriptionCompleted
111/7/2020Computer Not Turning OnNo


Patch Function Code
Patch( 'IT Helpdesk Tickets', LookUp('IT Helpdesk Tickets', ID=1), { Completed: true } )Code language: JavaScript (javascript)


Output

IT Helpdesk Tickets (SharePoint List)

IDDateDescriptionCompleted
111/7/2020Computer Not Turning OnYes




Scenario #1: Toggle

Patch a value found in a toggle to a Yes/No field.



Patch Function Code
Patch( 'IT Helpdesk Tickets', LookUp('IT Helpdesk Tickets', ID=1), { Completed: Toggle_Completed.Value } )Code language: JavaScript (javascript)




Scenario #2: Dropdown

Patch a value found in a dropdown to a Yes/No field.



Patch Function Code
Patch( 'IT Helpdesk Tickets', LookUp('IT Helpdesk Tickets', ID=1), { Completed: If( Dropdown_Completed.Value="No", false, Dropdown_Completed.Value="Yes", true ) } )Code language: JavaScript (javascript)