Skip to main content

Notifications

Community site session details

Community site session details

Session Id :

#8 Patch Choice Field and Lookup Field in SharePoint

Ram Prakash Profile Picture Ram Prakash 5,266 Super User 2025 Season 1

Usually in SharePoint for patching Text field we can easily patch it to PowerApps by using below code

 

 

 

Patch(tableName,Defaults(tableName),{FieldName:TextValue})

 

 

 

but for Creating/Updating the Choice/Lookup field we need to use different way to Update the same. 

 

To Patch Choice Field

 

 

Patch('Sharepoint List Name', Defaults('Sharepoint List Name'),
{choice:
 {'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
 Id:1,
 Value:"Enter Choice #2"} // Approved
 }
)

 

 

 

To Patch lookup Field

 

 

 

Patch('Sharepoint List Name',
 Defaults('Sharepoint List Name'),
 {Lookup:{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
 Id:'ID OF THE RECORD',//Gallery1.Selected.ID
 Value:'Value of the Record'}//Gallery1.Selected.Title
 }
 )

 

 

 

Comments

*This post is locked for comments