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 / Removing item from a l...
Power Apps
Answered

Removing item from a large (over 2k) Sharepoint list in a PA gallery

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello Power App Wizards!!!

 

I have looked at a few posts here describing this problem, but nothing I have tried is working. As others have stated this was working fine until we reached the over 2k wall.

 

I have a Sharepoint list called ProjectTasks with over 7000 items.

I have a gallery:

mvandelinde_0-1634136699279.png

 

I would like for my users to be able to Select the Trash Icon to delete an unnecessary task, essentially just deleting a line in that ProjectTasks list. A couple of things I've tried are: 

OnSelect

RemoveIf(CH_ProjectTasks, ID=ThisItem.ID)

//RemoveIf(CH_ProjectTasks,ID=Gallery1.Selected.ID)

 

but so far nothing is working.

THANK YOU!

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

    @Anonymous 

    Your RemoveIf function based on the ID will work.  You need to rely on the primary key to identify a record beyond the record limit and it will work fine.

     

    Since your gallery is based on a collection - your gallery is not going to update when you delete a record because the collection is a static snapshot.  If you look in your SharePoint list after you initiate the RemoveIf(CH_ProjectTasks, ID=ThisItem.ID), that item should be gone at that point.

     

    I hope this is helpful for you.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi Randy,

    I thought the same thing, but I have checked/refreshed the SharePoint list multiple times and the task is still there. The crazy thing is that I can see that PA is thinking about something after selecting the trash can, but no change.

    -Michele

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

    @Anonymous 

    Hmmm, I just verified here.  

    I have a list with 3000 items.  I have a Gallery that shows items beyond the record limit (record limit set to 5 in app - however Galleries ignore the record limit).  That Gallery is showing a record that is at ID 2987 (for example) and there is a trashcan icon with the formula RemoveIf(BigList, ID=ThisItem.ID)  When it is clicked, record number 2987 is deleted from the SharePoint list. No problem.

     

    Not sure if this one is related, but make sure your Formula-Level Error Management feature is turned on in the app.

     

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi Randy,

    Thank you so much for even responding! I'm pretty new to Power Apps and some days are definitely challenging.  

     

    I had someone else look at it, just to make sure that I'm not losing it, but it really wasn't working. After a lot of trial and error this is what we came up with and it seems to be working. (Note that I am using "Remove" instead of "RemoveIf") The collections are how I'm getting the gallery to refresh. 

     

     

    Remove(CH_ProjectTasks,ThisItem);
    Concurrent(
    ClearCollect(colTaskPage1, Filter(CH_ProjectTasks,IDCustom >=1 And IDCustom <2000)),
    ClearCollect(colTaskPage2, Filter(CH_ProjectTasks,IDCustom >=2000 And IDCustom <4000)),
    ClearCollect(colTaskPage3, Filter(CH_ProjectTasks,IDCustom >=4000 And IDCustom <6000)),
    ClearCollect(colTaskPage4, Filter(CH_ProjectTasks,IDCustom >=6000 And IDCustom <8000))
    );
    
    ClearCollect(colTaskPageALL, colTaskPage1, colTaskPage2, colTaskPage3, colTaskPage4)

     

    -Michele

  • WarrenBelz Profile Picture
    156,748 Most Valuable Professional on at

    Hi @Anonymous ,

    Firstly @RandyHayes is correct - it should delete and I do the same thing on a list with over 20k items.

    I thought I would add a small contribution here though - why bother re-collecting - you just need to "double-delete" - from the list and also from the collection. I regularly "double patch" for the same reason when I have a gallery based on a collection for mobile device search performance.

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi Warren, Thank you for your contribution! I was re-collecting because I never even considered a "double-delete", it makes so much sense!

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 345 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 312

#3
Mohsin Ali Profile Picture

Mohsin Ali 252

Last 30 days Overall leaderboard