#8 Patch Choice Field and Lookup Field in SharePoint
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
}
)
*This post is locked for comments