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 / Patching multiple rows...
Power Apps
Answered

Patching multiple rows from a selected item in a Gallery

(0) ShareShare
ReportReport
Posted on by 58

Hi, I have some issues with figuring out the patching formula so any help would be appreciated!

 

I have a table (named Projects) in excel which I connected to a gallery.

This is the example table:

CompanyProjectFinished?
AOne 
ATwo 
BThree 
BFive 
BFour 
BSix 
CEight 
CTen 
CNine 

And I have a Gallery (named GalleryCompany) which shows the items A and B.

 

I want to make a button that would patch all of the Projects under company A or B, depending on which one is selected in the GalleryComapany. That means if I select the C (Title1 of GalleryCompany) in the list and click the button, the projects Eight, Nine and Ten should get a "Yes" Tag in the Finished? column.

 

This is the code I've been trying to apply but without success:

 

ForAll(Projects.Project,
Patch(Projects, LookUp(Projects, Company = Title1.Text),
{Finshed?: "Yes"}
))

 

 

EDIT: I also tried with this but the same happens (just the first value gets updated):

 

ForAll(Projects.Project,
Patch(Projects, LookUp(Projects, Company = GalleryCompany.Selected.Result),
{Finshed?: "Yes"}
))

 

 

Only the first record (Eight) gets tagged. I also tried with the UpdateIf formula but that didn't write anything. I also tried changing the ForAll source to the gallery but didn't get anything.

 

Any suggestions or help would be great! I am still very new and learning the ropes of PowerApps 🙂

 

Thank you in advance!

Categories:
I have the same question (0)
  • Verified answer
    v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @shibathedog ,

     

    According to your description, I've made a test for your reference:

    1\ This is my table ‘Table1’.

    v-xiaochen-msft_0-1613101350466.png

     

     

    2\ Add a button control and set its onselect property to:

    ClearCollect(AAA,Table1) // This step cannot be omitted

     

    3\ Add a combo box control ‘ComboBox3’ and set its Items property to:

    Distinct(Table1,Company)

     

    Set the combo box control’s DisplayFields property to:

    ["Result"]

     

    4\ Add a gallery control 'Gallery5' and set its items property to:

    Ungroup(ForAll(ComboBox3.SelectedItems,Filter(AAA,Company=Result)),"Value")

     

    5\ Add a button control and set its onselect property to:

    ForAll(Gallery5.AllItems.Project As ABC,Patch(Table1,LookUp(Table1,Table1[@Project]=ABC[@Project]),{'Finished?':"Yes"}));ClearCollect(AAA,Table1)

     

    6\ The result is as follows:

    v-xiaochen-msft_1-1613101350468.png

     

    v-xiaochen-msft_2-1613101350470.png

     

    v-xiaochen-msft_3-1613101350472.png

     

    v-xiaochen-msft_4-1613101350474.png

     

     

    Best Regards,

    Wearsky

    If my post helps, then please consider Accept it as the solution to help others. Thanks.

  • shibathedog Profile Picture
    58 on at

    Hi @v-xiaochen-msft , 

    I am so sorry, I just now have seen that I didn't reply to you nor accept this as the solution! I thought I did but guess I forgot. Thank you for this, it was very helpful in building what I wanted but this unfortunately cannot be replicated in my app because I have to have 1 gallery and 1 button, nothing else. But this helped me in many other ways so thank you very much!! 🙂

     

    Kind regards!

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 325 Most Valuable Professional

#2
11manish Profile Picture

11manish 165

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 88 Super User 2026 Season 1

Last 30 days Overall leaderboard