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 / Will Patch Update ONLY...
Power Apps
Answered

Will Patch Update ONLY the Item Associated with the 'ID"

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I need this Patch to update the fields within it for ONLY the Member and CQTitle associated with Defaults(MemberCertsandQualsList.ID). I am pulling the 'ID' from the SP list MemberCertsandQualsList.

Will the below do what I desire, and not update any other items on the list.

Patch(MemberCertsandQualsList,

Defaults(MemberCertsandQualsList.ID),

{DteofCQ:Value(UpdateCQDateofAwardFld.Text), CQYr:Value(UpdateCQStandardYearFld.Text), CertBody:UpdateCertifyingBodyFld.Text, CQTitle:UpdateCQTitleFld.Text, CertNo:Value(UpdateCertNumberFld.Text), ClassNumber:Value(UpdateClassNumberFld.Text), ClassStartDate:Value(UpdateCQClassStartDateFld.Text), ClassEndDate:Value(UpdateCQClassEndDateFld.Text), AcrdtnAgncy:EditAccredingAgencyDropdown.Selected.Value, Rcprcty:EditReciprocityDropdown.Selected.Value});

 

3csman_0-1613005871760.png

 

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    Your syntax is incorrect for the Defaults function.  Defaults is used to specify a New record for a list.  There is no ID associated with it and will be blank in your scenario. 

     

    When you use Patch, you specify the datasource, the record and the column values (as a record).

     

    I am not sure exactly what you are trying to do from your description as you reference Defaults(MemberCertsandQualsList.ID), which is not valid.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    The data is from an update form (really a Gallery). 

     

    The user changes whatever needs to be updated of the default information (from the MemberCertsandQaulsList based on varIsUpdateMemberRecord, which has all the data for the fields, again from the MemberCertsandQaulsList.

     

    I am trying to Patch back (overwrite to the same item on the same list the changes above, only overwriting those fields shown in the Patch.

     

    Is this more apppropriate:

     

         

    Patch(MemberCertsandQualsList,

             Lookup(MemberCertsandQualsList,MemberCertsandQualsList.UpdateFormItemIDNo.Text),

     

    With the contents of UpdateFormItemIDNo.Text (in the Update Gallery) being the ID of the item in 

    MemberCertsandQualsList?

     

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    Since you already have the ID in the list, you can utilize the following instead:

    UpdateIf(MemberCertsandQualsList, ID=varIsUpdateMemberRecord.ID, {...the columns you want to update})

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Crying early...

     

    I don't have a varIsUpdateMemberRecord. Should I create one? I do have a varEditCertQualRecord; is it the source that populates the Gallery (and has the 'ID'.

     

    3csman_0-1613055645930.png

     

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    A little confused...you said:

    "based on varIsUpdateMemberRecord, which has all the data for the fields,"

    So what was that?

     

    Also, you will not be patching and updating...get rid of the Patch part of that formula, the first line.

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I must have misspoken somewhere. The variable is varIsUpdateMemberRecord. I took out the Patch part and the error went away.

     

    3csman_0-1613058892265.png

     

     

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 483

#2
WarrenBelz Profile Picture

WarrenBelz 399 Most Valuable Professional

#3
11manish Profile Picture

11manish 327

Last 30 days Overall leaderboard