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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Patch to Update Existi...
Power Apps
Answered

Patch to Update Existing Record - SharePoint List Data Source

(0) ShareShare
ReportReport
Posted on 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:
I have the same question (0)
  • C-Papa Profile Picture
    1,836 on at

    Does it work if you change 

    dropdownOppName.Selected.Title

    to 

    dropdownOppName.Selected.Value

    or 

    dropdownOppName.Selected.Result

     

  • Community Power Platform Member Profile Picture
    on at

    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")

     

  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    on at

    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 at

    @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"}}
    )

     

  • andrewmccourt64 Profile Picture
    14 on at

    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?

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard