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

Day 11 - Customizing Option Sets Dropdown Fields with JavaScript

  In this Blog, we will see how to Customizing Option Sets Dropdown Fields with JavaScript label1 = formContext.getAttribute( "bosch_op...