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 / bulk update records in...
Power Apps
Unanswered

bulk update records in PowerApps from checkbox selection

(1) ShareShare
ReportReport
Posted on by 428

I want to update bluk record in sharepoint using powerapp gallery 

 

I have created gallery and added check box inside gallery and written below formula 

OnCheck property of Gallery >If(IsBlank(LookUp(CheckedItems, 'SID'=ThisItem.'SID')),Collect(CheckedItems,LookUp(CheckedItems, 'SID'=ThisItem.'SID')))
OnUncheck:If(!IsBlank(LookUp(CheckedItems,'SID'=ThisItem.'SID')),Remove(CheckedItems,LookUp(CheckedItems, 'SID'=ThisItem.'SID')))


Now on Button select i want to update status Done for all checked check box item, writting below formula but not working getting error = inavlid arguemnt type

 

ForAll(CheckedItems,Patch(SPTest,LookUp(SPTest,'SID'=CheckedItems[@SID]),{Status:{Value:"Done"}}))

Categories:
I have the same question (0)
  • poweractivate Profile Picture
    11,078 Most Valuable Professional on at

    @Ashok2 

     

    Square brackets are not used to access the record in PowerApps as per your usage CheckedItems[@SID], they are used only sometimes to initialize a collection. Therefore that is not valid usage. In some programming languages this could be the case but PowerApps does not access Table elements by Index using the square brackets. Consider Something like this example:

     

    Suppose a Collection called SomeCollection

     

    You cannot say SomeCollection[1] to access index 2 of SomeCollection.

    Instead, use something like Last( FirstN(SomeCollection,2) ) to access the 2nd element of SomeCollection

     

    Also in ForAll the formula is evaluated on each record, so the record does not have to be fetched with array index notation (which again, we do not believe array index notation is currently how PowerApps works).

     

    Try reframing it another way assuming that ForAll's second parameter, the Formula, already is context aware - because the Formula is evaluated in each record of the provided Table according to https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-forall

  • CU-18081211-6 Profile Picture
    9,270 Moderator on at

    The bold text is a syntax error. You can write {Status:"Done"}, i think it will be enough.

    ForAll(CheckedItems,Patch(SPTest,LookUp(SPTest,'SID'=CheckedItems[@SID]),{Status:{Value:"Done"}}))

     

    Please be carefull that this approach (with lookup for Sharepoint list  inside a patch in forall loop) might give you a delegation warning. Isn't so ? (a small yellow icon near the button).

  • Ashok2 Profile Picture
    428 on at
    I get error here
    ,'SID'=CheckedItems[@SID]), in equal and correct delegation warning as well if it's not recommended what else can be used?
  • CU-18081211-6 Profile Picture
    9,270 Moderator on at

    I don't think you need the qoutes: SID=CheckedItems[@SID])

  • Ashok2 Profile Picture
    428 on at

    [@SID] Name isnt valid :the identifer isn't recognized error and delegaton as well , can i change this formula to get expected result

  • Ashok2 Profile Picture
    428 on at

    @poweractivate  

     

    Yes its correct i reframed my formula to below  and it is working as expected

     

    ForAll(RenameColumns(Filter(Gallery.AllItems,Checkbox3_1.Value),"ID","ID1"),Patch(SPList,LookUp(SPList,ID=ID1),{Status:{Value:"Done"}}))

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 842

#2
Valantis Profile Picture

Valantis 563

#3
Haque Profile Picture

Haque 402

Last 30 days Overall leaderboard