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 / How to update a item u...
Power Apps
Unanswered

How to update a item using patch

(0) ShareShare
ReportReport
Posted on by

Hi all,

 

I have a power app which I want to update the "repaired" column via the powerapp 

 

I have tried using Patch('Repair log', ThisItem , {Repaired: Toggle1.Value}) Which doesnt work, where am I going wrong: 

 

Screenshot 2022-10-17 at 11.40.59 AM.pngScreenshot 2022-10-17 at 11.44.02 AM.png

 

The column within the Sharepoint list is a Yes/No column 

Categories:
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @AB21 

    Replace ThisItem with LookUp('Repair Log',ID=BrowseGallery1.Selected.ID)

     

  • Leandro_neets Profile Picture
    21 on at

    Hi,
    I'm not specialist. But I think "ThisItem" is refferencing to nothing. To make this work, you should go to another screen selecting the corresponding item, or, I have found a similar solution that I used for myself:
    Go to "OnCheck" property of that toggle, create a collection receiving that item: Collection(Mycollection;ThisItem), Go to "OnUncheck" property of that toggle and put: Remove(Mycollection; ThisItem). On "OnSelect" of your save button put: ForAll(Mycollection, Patch('Repair log',{ Repaired: ThisRecord.Toggle1.value})

    And then, remember to clean your collection. Clear(Mycollection).
    Again, I'm not speciallist, but I hope this could help. 

  • AB21 Profile Picture
    on at

    Hi @Drrickryp 

     

    Thank you, how do I update any item that I turn toggle on for? 

     

    I am using: Patch('Repair log', LookUp('Repair log',ID=BrowseGallery1.Selected.ID, {Repaired: Toggle1.selected})) 

     

    Screenshot 2022-10-17 at 12.33.14 PM.pngScreenshot 2022-10-17 at 12.33.28 PM.pngScreenshot 2022-10-17 at 12.33.35 PM.png

  • AB21 Profile Picture
    on at

    Hi @Leandro_neets What would the collection be for if I have a sharepoint list as the data source

  • Leandro_neets Profile Picture
    21 on at

    @AB21 To determinate which record do you want to update. 

     

    Also, using the suggestion @Drrickryp gave, try to replace the end

     

    I am using: Patch('Repair log', LookUp('Repair log',ID=BrowseGallery1.Selected.ID, {Repaired: Toggle1.value})) 

  • AB21 Profile Picture
    on at

    Hi @Leandro_neets @Drrickryp 

     

    Patch('Repair log', LookUp('Repair log',ID=BrowseGallery1.Selected.ID, {Repaired: Toggle1.value})) corrected any errors however the toggle once clicked save goes back to off. 

     

    The column "Repaired" in my Sharepoint list is a Yes/No column and also doesn't update the Sharepoint list once clicking save 

     

    Screenshot 2022-10-18 at 8.22.52 AM.pngScreenshot 2022-10-18 at 8.23.43 AM.png

  • Leandro_neets Profile Picture
    21 on at

     @AB21,

    You don't have any item on gallery selected yet, that's why it is not updating data on SP list. 

    Go to OnCheck property of that Toggle and put "Select(parent)" on it. 

    But remember, once you set another toggle as true, it will override the gallery selection. (you will be able to update one record per time, even you have many toggle set as true).

     

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 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 258

#3
Mohsin Ali Profile Picture

Mohsin Ali 231

Last 30 days Overall leaderboard