web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Update a column value ...
Power Apps
Unanswered

Update a column value for items in a gallery with one button click from outside gallery power apps

(0) ShareShare
ReportReport
Posted on by 431

Hello Power Users,

 

I have a requirement where I need to update a single column value in all items inside a gallery with a button click that button is out side the gallery. Below is the syntax I tried but didn't work out.

 

ForAll(MyGallery.AllItems, Patch(MyDataSource, LookUp(MyDataSource, ID = ThisItem.ID), {ColumnNameToUpdate: NewValue}))

 

Can anyone please help me?

 

Thanks in advance

I have the same question (0)
  • Michael E. Gernaey Profile Picture
    53,335 Super User 2025 Season 2 on at

    @KrishR 

     

    You are really really close

    Do this

    ForAll(MyGallery.AllItems,
     Patch(MyDataSource, ThisRecord, 
     {
     ColumnNameToUpdate: NewValue
     }
     )
    );


    If you like my answer, I would really appreciate if you please Mark it as Resolved, and give it a thumbs up, so it can help others

    Cheers

    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

  • KrishR Profile Picture
    431 on at

    @FLMike ,

    Thank you for the help.

     

    I tried and didn't workout some how. When I hover on the database/Dataverse Table  the error message says "Invalid argument type (GUid). Expecting a Table value instead"

    When I hover on the ThisRecord section it says "The specified column '_ownerid_value' does not exist"

    And when I hover on the column I want to update it say "The Specified column 'columnName' doesn't exist". Not sure about this error message when I start typing it showed up in below suggestions and now it says doesn't exist.

     

    Can you please let me know if I'm doing something wrong?

     

    Thanks again for your help

     

     

  • Michael E. Gernaey Profile Picture
    53,335 Super User 2025 Season 2 on at

    hi @KrishR 

     

    Let me first explain what the code I shared does.

     

    When you use a ForAll it is giving you a loop of records (because the data in a gallery is records).

    To Patch a record, you have to tell the Patch statement, which Record/Row to update.

    When you are looping the gallery, ThisRecord is the pointer to that record.

     

    So there is an issue possibly with what you filed in for the rest of the stuff, so if you can please share your code (after I gave it to you).

     

    Then we can chat some more about whats wrong. Also, could you please run it, and when you get the error, can you stop the app and show me where you are hovering and take a screenshot.

     

    Happy to help get you working


    If you like my answer, I would really appreciate if you please Mark it as Resolved, and give it a thumbs up, so it can help others

    Cheers

    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard