web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Patch function doesn't...
Power Apps
Unanswered

Patch function doesn't work with Person/Group field - NewForm

(0) ShareShare
ReportReport
Posted on by 195

Hi,

 

I have designed a Powerapps form with SharePoint as the datasource. Mostly in my form, I have used field from SharePoint as the datasource.

 

I have added an additional field (combobox) from Powerapps, for which i should save the selected value into the Person field in SharePoint.

 

Hence in NewForm, OnChange of that field, I have written below Patch function.

 

Patch('DS',NewForm.LastSubmit,{'Registrar':DataCardValue15_1.Selected});

 

However, when i submit the form, the field value doesn't gets saved into SharePoint. I have used the same Patch function even in OnSuccess of the form, still cannot save.

 

Any advice please

 

 

 

 

Categories:
I have the same question (0)
  • PowerAddict Profile Picture
    7,316 Most Valuable Professional on at
    To patch LookUp fields to SharePoint, you need to include the following attributes:
    1. '@odata.type',
    2. Id and
    3. Value

    1. '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"

    2. Id: ID of the record

    3. Value: Value of the record

    Here is an example from one of the online blogs, include this in the Patch function:

    {'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
    Id:Gallery1.Selected.ID,
    Value:Gallery1.Selected.Title}
    }

    Let me know if this helps.

    ---
    If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

    Hardit Bhatia
    https://thepoweraddict.com
  • poweractivate Profile Picture
    11,078 Most Valuable Professional on at

    @Kumar9024021 

     

    @PowerAddict  suggested you to included odata.type

     

    In our case we usually notice faster performance when leaving odata.type out. Especially when for instance, Patching the record. If we leave it in, it is much slower. If we leave it out, it is much faster. It usually works when we leave odata.type out as well.

     

    However @Kumar9024021 if it only works for you using that odata.type, then you may need to use it that way. Maybe in some cases it has to be there. When we do Patch we take it out and the performance is at least 10x better. There is noticeable lag in our case if we leave odata.type in there, and it works correctly and much better without it - however it may depend on your case.

     

     

  • v-siky-msft Profile Picture
    Microsoft Employee on at

     will@Kumar9024021 

    Does the additional field (combobox) locate inside the Form?

    What is the Items property of combo box?

     

    If the field is in the form, there is no need to use patch function. 

    1. set the combo box items: Choices('DS'.Registrar)

    2. set the Update of data card: DataCardValue15_1.Selected

    when you submit the form, the selected person will be saved into the list.

     

    If the field is outside the form,  I follow your formula and it can work well, so please follow my steps and check if there is any difference from yours.

    1. set the combo box items: Choices('DS'.Registrar)

    2. set OnSuccess of Form: Patch('DS',NewForm.LastSubmit,{'Registrar':DataCardValue15_1.Selected});

    3. set submit button OnSelect: SubmitForm(NewForm)

    Note: you can not use NewForm function before Patching the selected person, because once NewForm is executed, the NewForm.LastSubmit will be empty.

    Snipaste_2020-01-14_15-15-03.pngSnipaste_2020-01-14_15-15-18.png

    Sik

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 427 Most Valuable Professional

#2
11manish Profile Picture

11manish 201 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard