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 / Update the gallery mul...
Power Apps
Answered

Update the gallery multi article

(0) ShareShare
ReportReport
Posted on by 101

Hello,

Sorry for my bad English

 

I am looking with a button to update the data of a column of each item according to a text present in a personalized label of each item

 

I start from there but it doesn't work, it seems that the update doesn't apply for all the lines... it gives me the same value everywhere !

 

ForAll(BrowseGallery1.AllItems;UpdateIf(Truck;Etat<>Etat_JIT.Text;{Etat:Etat_JIT.Text}))

 

"Etat" is the name of my column and "Etat_JIT" the name of my label in the gallery

 

I don't know if I'm clear, there's already a language barrier but also my power apps level

Categories:
  • Verified answer
    WiZey Profile Picture
    3,023 Moderator on at

    Hello @Thomaw (let's have a language barrier issue together),

     

    If I understood your issue, you want to save all changes made in a gallery to a database after clicking on a button?

     

    My suggestion is you need three steps in your process:

     

    First, your gallery should work on a collection...

     

    ClearCollect(colPowerApps;AddColummns(Truck;"Etat_JIT";Etat))

     

    ... And every time a value is changed in the gallery, the collection is updated as well. On the "OnChange" property of your InputText, you need something like this:

     

    UpdateIf(colPowerApps;ID = ThisItem.ID;{Etat_JIT:Self.Text}))

     

    Then, you use "ForAll()" to read your collection and "UpdateIf()" to update your database the same way you did.

     

    ForAll(colPowerApps;UpdateIf(Truck;And(ID = ThisRecord.ID; Etat <> ThisRecord.Etat_JIT);{Etat:ThisRecord.Etat_JIT}))

     

  • Thomaw Profile Picture
    101 on at

    Hello and thank you for your support 🤗

     

    I forgot to specify that my gallery works on an excel onedrive connection and it must stay like that.

    You wouldn't have anything else as a solution ?

  • Thomaw Profile Picture
    101 on at
    If I understood your issue, you want to save all changes made in a gallery to a database after clicking on a button?

     

    And to answer your question, I want to save in my excel workbook the changes that are in the label of each item

     

     

  • WiZey Profile Picture
    3,023 Moderator on at

    Hello @Thomaw ,

     

    I'm not familiar with OneDrive connector, so everything I'm going to say are assumptions based on what I see in documents and others' topics.

     

    I believe the "UpdateIf()" I suggested may work, as long as your Excel table is declared as a table and has a key column to act as an unique ID then Power Apps will be able to identify the file, the table and the row to update.

  • Thomaw Profile Picture
    101 on at

    Yes precisely, my file has a unique id on each line: "Pick ID"

     

    It can help?

  • WiZey Profile Picture
    3,023 Moderator on at

    Only one way to find out. How does the code I suggested goes?

  • Thomaw Profile Picture
    101 on at

    I think I found thanks to your help

     

    ClearCollect(colTruck;RenameColumns(BrowseGallery1.AllItems;"PICK_ID";"newPICK_ID"));;
    ForAll(colTruck;UpdateIf(Truck;And(newPICK_ID = ThisRecord.PICK_ID);{Etat:Etat_JIT}));;
  • Thomaw Profile Picture
    101 on at

    Merci @WiZey 

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