cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Post Prodigy
Post Prodigy

Isse with Patch function

Hi Team -

 

I have a form that I need to patch from.

 

I'm trying to patch a SP List called "RD_Partnership_List" and Patch NULL to two column values - Portfolio_ID & Portfolio_Alias.

Patch(RD_Partnership_List,{ID:DataCardValue90.Text}, {Portfolio_ID:"diditwork" , Portfolio_Alias:Blank()})

 

DataCardValue90.Text represents that node on my CURRENT form that I am Patching in the list RD_Partnership_List. This executes but I don't see any changes.  Can anyone let me know where I may be going wrong?

 

Portfolio_ID & Portfolio_Alias are not choice/drop fields.   Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: Isse with Patch function

@simms7400 

So close... you almost had it!

 

Patch(
    RD_Partnership_List,
    LookUp(RD_Partnership_List,ID=Value(DataCardValue90.Text)),
    {Portfolio_ID:"diditwork", Portfolio_Alias:Blank()}
)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

5 REPLIES 5
Highlighted
Super User
Super User

Re: Isse with Patch function

@simms7400 

So close... you almost had it!

 

Patch(
    RD_Partnership_List,
    LookUp(RD_Partnership_List,ID=Value(DataCardValue90.Text)),
    {Portfolio_ID:"diditwork", Portfolio_Alias:Blank()}
)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

Highlighted
Community Support
Community Support

Re: Isse with Patch function

Hi @simms7400 ,

 

Syntax: Patch( DataSource, BaseRecord, ChangeRecord1 )

The <Base record> is the record you want to patch, so you have to use LookUp function to find out the record your form shows, and ID column is number type, you should use Value function. Please modify your formula as below:

Patch(RD_Partnership_List, LookUp(RD_Partnership_List, ID=Value(DataCardValue90.Text)), {Portfolio_ID:"diditwork" , Portfolio_Alias:Blank()})

 Best regards,

Sik

Highlighted
Post Prodigy
Post Prodigy

Re: Isse with Patch function

@mdevaney 

 

Thank you so much, that worked like a charm!

 

@v-siky-msft   Thank you for your input!

 

I do have one more question. What is the best way to track a ComboBox field changing from populated to empty (user selection on an edit form)? I ask because that its when I need to execute the patch statement when the ComboBox box on one of my edit forms goes from populated to null.

 

Thank you!

Highlighted
Post Prodigy
Post Prodigy

Re: Isse with Patch function

Highlighted
Super User
Super User

Re: Isse with Patch function

You are on the the right track. Definitely use the OnChange property of the ComboBox to do this.

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,362)