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 / Help with FUNCTION Pat...
Power Apps
Answered

Help with FUNCTION Patch DOESN'T WORK

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello, good afternoon. 
Since 2 Days i'm trying to run in my app a button to save the edited labels. 

When i press the Button "Save" doesn't work! 

The database is a Sharepoint List. 

 

Button Formula:

 

 

 

ForAll(Gallery1.AllItems;Patch(Picking209_2;LookUp(Picking209_2; EAN = [@InputEAN].Text); {EAN: [@InputEAN].Text}))

 

 

 

 

 

Attach img. 

Anotación 2020-06-04 161422.png
Categories:
  • Verified answer
    WarrenBelz Profile Picture
    156,963 Most Valuable Professional on at

    Hi @Anonymous ,

    Firstly, you were attempting to patch records back to the same value (where EAN.Text matched, put the value back)

    Assuming all your values are correct and you have a unique ID in your data, try this 

    ForAll(
     Gallery1.AllItems;
     UpdateIf(
     Picking209_2;
     ID=Gallery1.Selected.ID; 
     {EAN: [@InputEAN].Text}
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

     

     

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

    Hi@JonathanDeleon,

    Based on the formula you provided, I think there is something syntax wrong with your formula.

    I agree with the most of@ WarrenBelz said, but there is a little difference between ours, the following is some explaining about the formula you provided.

    When we use Patch & LookUp, we actually try to find the record and update the specific field in it. In Patch(), there is a BaseRecord we need to find out when we want to modify a record and that’s why we use LookUp().

    In your formula, you quote EAN in LookUp() where you should put the primary key in. Considering you have a SharePoint list as the database, your primary key is the ID. You need to put the specific ID corresponding to the record you want to update in the EAN column.

    Please modify your formula as below:

    ForAll(
     Gallery1.AllItems;
     Patch(
     Picking209_2;
     Lookup(Picking209_2;ID=XXX), 
     { EAN: [@InputEAN].Text}
     )
     )

    Note: xxx is a specific value which you should quote from the Gallery1, maybe you can replace this with Gallery1.Selected.ID

     

    Best Regards,

    Qi

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

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 224 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 189 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 126

Last 30 days Overall leaderboard