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

How to update multiple rows in a SharePoint List using a ComboBox

(0) ShareShare
ReportReport
Posted on by 13

Hello,

 

I'm currently trying to update multiple rows in a SharePoint List "Toolbox Talks - Data" based off of the information given in a ComboBox. I have my rows, "Name", in the SharePoint List, and each column is designated as Sep. Week 1, Sep. Week 2, etc. I also have a ComboBox, "SelectedEmployees". I want the user to be able to select as many employees as they want, and then mark down in that column that all of those employees are marked as true. The following expression I have created creates two new rows, and marks down every column as true, so I know I've got something right, just not all the way:

 

ForAll(SelectedEmployees.SelectedItems.'Name (Title)',Patch('Toolbox Talks - Data', {'Dec. Week 4': true}))

 

The Collect function works identically, so I'm at a loss as what to do, and no other forum post seems to match my predicament (at least what I could find after half an hour). In the photo I've provided, the timestamp rows are irrelevant.

microsofthelp2.png
microsofthelp.png
Categories:
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @JFrenchKruse 

    To start, your formula has the ForAll backward. You are trying to use it like a ForLoop in some development language - which PowerApps is not.  ForAll is a function that returns a table of records based on your iteration table and record schema.

    It is more efficient to use the function as intended and will provide better performance.

     

    However, in your case, it is the UpdateIf function that will fit the need.

     

    But, what is the condition of your Patch?  As you have it now, it would only serve to create new records.

     

     

  • JFrenchKruse Profile Picture
    13 on at

    @RandyHayes 

    I want it to only update a single column of data per row specified within the ComboBox. I apologize if I can't answer your question fully, I've only started with PowerApps around a month ago. Thanks for the response!

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @JFrenchKruse 

    Well, this is more of a data source question.

     

    If you have, let's say, 300 records in your datasource - which one of them would you want to update with the combobox selection??

  • JFrenchKruse Profile Picture
    13 on at

    I want the ComboBox to correlate to the Names row within the List. My main issue is that I want to update more than one Name at a time.

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @JFrenchKruse 

    Sure...what is the Items property of SelectedEmployees?

  • JFrenchKruse Profile Picture
    13 on at

    The same SharePoint list that the columns I want to update are in - 'Toolbox Talks - Data'.

  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @JFrenchKruse 

    Very good.  Then, (the most important part) your items has the primary Keys of the records (the ID column).

     

    Therefore, your formula would be:

    Patch('Toolbox Talks - Data', 
     ForAll(SelectedEmployees.SelectedItems,
     {ID: ID, 
     'Dec. Week 4': true
     }
     )
    )
  • JFrenchKruse Profile Picture
    13 on at

    Upon testing that code, it works wonderfully! Thanks so much for your help, I've been stuck on this for the better part of a couple days. You're amazing!

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @JFrenchKruse 

    Yes...not a problem.  Just remember - a ForAll is NOT a For Loop.  It is a table creating function.

     

    In the formula I provided, we are supplying Patch with a table of records that have an ID and the other column you want to change.  Patch is smart enough to know that if you provide the primary key (ID in this case) that it will update the associated record for that ID.  

    So, the ForAll creates the table of records to change and passes that to Patch which then acts on the table.

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 402 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 296 Most Valuable Professional

Last 30 days Overall leaderboard