web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Removing from Collecti...
Power Apps
Suggested Answer

Removing from Collection also removes from SharePoint List

(1) ShareShare
ReportReport
Posted on by 151
Hello,
 
I am at a complete loss and have no idea what else to try. I have a collection in a gallery that is displaying filtered down records from SharePoint. In this gallery the user has an option to delete items. When items are deleted from the gallery, they are added to a second collection (itemstodelete). When the user submits my form, this is when all items that were deleted from the gallery are processed. 
 
Here is that code while I am also hovering over the collection so you can see the ID. Shouldnt this be whats in "Value(ThisRecord.ID)"??
 
 
 
 
 
But as you will see in the screenshot below, this is what's returned. My first record in SharePoint. Not the targeted (ID:123) one. 

 
 
 
Ive tried creating custom calculated columns, Ive tried changing around the values from being numbers or text. Nothing works. Maybe I am should go about this in another way?
 
 
thanks,
Jake
 
Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,079 Most Valuable Professional on at
    Hi  Jakegolden 
    Firstly, please post your code in Text - saves re-typing here. ID in a SharePoint list is a number, so I a am assuming it is also a number in the collection ? If so
    ForAll(
       itemstodelete As _Data,
       Remove(
          'RCA Corrective Actions', 
          LookUp(
             'RCA Corrective Actions', 
             ID = _Data.ID
          )
       )
    )
    If Text in the collection you will need
    ID = Value(_Data.ID)
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee
  • Suggested answer
    CamiloLuque Profile Picture
    157 on at
    Hi. Is not necessary use ForAll funtion, you can use RemoveIf function instead. See below:
     
    OnSelect property of a  button I have ClearCollect(colAllItems, SharePointListName). When I pressed the delete button, I'm deleting the item from colAllItems and collect in the colItemsToDelete:
     
     
    The collection colItemsToDelete grow:
     
     
    The Delete queue from SharePoint button, in its property OnSelect. (mll_generalInformation is the SharePoint list):
     
  • WarrenBelz Profile Picture
    153,079 Most Valuable Professional on at
    Yes RemoveIf() works as well but has potential Delegation issues unless you turn on the Experimental setting to enable this.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard