Skip to main content

Notifications

Community site session details

Community site session details

Session Id : 0b1qxvy14URn3W6WFfUcua
Power Apps - Building Power Apps
Answered

Patch to Update Existing Record - SharePoint List Data Source

Like (0) ShareShare
ReportReport
Posted on 28 Apr 2021 15:55:41 by

I have an occasion to use Patch() to update an existing record outside of the context of a form or a gallery.  I have a file uploader using an attachment control and when upload is successful (i.e., OnAddFile), I need to execute a Patch() to update a choice field, 'Status' in SP.  My issue is that Power Apps does not recognize 'Title' the default single line text column inherent with every SP list. The formula throws an error saying it does not recognize the Title as a valid column in the SP list.  The dropdownOppName.Selected.Title is working and retrieving the correct record so it's just the Title column is not recognized. Any recommendations?

 

Patch('Signatures', 'Title' = dropdownOppName.Selected.Title, {Status.Value: 'Contract Docs Received'})

 

 

Categories:
  • andrewmccourt64 Profile Picture
    14 on 13 Jul 2022 at 13:58:39
    Re: Patch to Update Existing Record - SharePoint List Data Source

    How can you get this to work if your base sharepoint list is >10,000 records? Lookup() will only check the top 2000 rows or so won't it?

  • Community Power Platform Member Profile Picture
    on 29 Apr 2021 at 12:57:18
    Re: Patch to Update Existing Record - SharePoint List Data Source

    @v-qiuyu-msft - Thank you for the detailed response!  You provided the solution as shown below.

    Patch('Signatures', 
     LookUp('Signatures','Title' = dropdownOppName.Selected.Title), 
     {Status: {Value: "Contract Docs Receieved"}}
    )

     

  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    on 29 Apr 2021 at 02:39:57
    Re: Patch to Update Existing Record - SharePoint List Data Source

    Hi @Anonymous,

    Do you want to patch an existing record to you SP list?

    Could you please share a bit more about the scenario?

    Here is a standard Patch function, a base record is required if you want to update an existing record. 

    PatchDataSourceBaseRecordChangeRecord1 [, ChangeRecord2, … ])

    The formula you provided does not have a record, the parameter you referred in invalid.

    'Title' = dropdownOppName.Selected.Title

    Do you want to update the record that title has the Dropdown selected value?

    Please modify your formula as below:

    Patch('Signatures', 
     LookUp('Signatures','Title' = dropdownOppName.Selected.Title), 
     {Status: {Value:"xxx"}}
     )

    Note that you should update a Choice column as below

    {ChoiceColumn:{Value:"xxx"}}

    Note that you should specify a certain value rather than a column name for the Choice column.

    Check if it helps.

    Regards,

    Qi

     

  • Community Power Platform Member Profile Picture
    on 28 Apr 2021 at 18:16:05
    Re: Patch to Update Existing Record - SharePoint List Data Source

    Thanks for the response.  That dropdown menu has the Items property set to display OppName while also making related columns available and that is working as expected (see code below).  The issue is Title is not recognized within the Patch() formula which is very odd behavior.

    Filter(SortByColumns(ShowColumns(colSignatures, "OppName", "OppID", "Status", "DueDate", "SignatureName", "LegalRep", "Requestor", "Title"), "OppName"), Status.Value <> "Archived")

     

  • C-Papa Profile Picture
    1,836 on 28 Apr 2021 at 16:08:32
    Re: Patch to Update Existing Record - SharePoint List Data Source

    Does it work if you change 

    dropdownOppName.Selected.Title

    to 

    dropdownOppName.Selected.Value

    or 

    dropdownOppName.Selected.Result

     

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Building Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 89 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 60

#3
stampcoin Profile Picture

stampcoin 48

Overall leaderboard
Loading started