Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Microsoft Dataverse
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

Categories:
  • Michael E. Gernaey Profile Picture
    42,295 Super User 2025 Season 1 on at
    Re: Update a column value for items in a gallery with one button click from outside gallery power apps

    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

  • KrishR Profile Picture
    431 on at
    Re: Update a column value for items in a gallery with one button click from outside gallery power apps

    @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
    42,295 Super User 2025 Season 1 on at
    Re: Update a column value for items in a gallery with one button click from outside gallery power apps

    @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

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Microsoft Dataverse

#1
mmbr1606 Profile Picture

mmbr1606 22 Super User 2025 Season 1

#2
stampcoin Profile Picture

stampcoin 17

#3
ankit_singhal Profile Picture

ankit_singhal 11 Super User 2025 Season 1

Overall leaderboard

Featured topics