Wednesday, September 1, 2021

How to Patch Choice Field and lookup in Sharepoint Powerapps

 Hello All,


Usually in Sharepoint for patching Text field we can easily patch it to Powerapps

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


Please find the below Code to Patch choice field and Lookup Field in PowerApps

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

              }

         )

 


No comments:

Post a Comment

How to Import Data from Excel to Multiple tables in PowerApps

Introduction:   I have created a view on how to import data from excel to multiple tables in Canvas PowerApps   Implemented Steps: ...