cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

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

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

 

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

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

 

3csman_0-1613058892265.png

 

 

View solution in original post

6 REPLIES 6
RandyHayes
Super User
Super User

@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.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
Anonymous
Not applicable

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
Super User
Super User

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

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
Anonymous
Not applicable

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
Super User
Super User

@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.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
Anonymous
Not applicable

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

 

3csman_0-1613058892265.png

 

 

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,444)