Skip to main content
Community site session details

Community site session details

Session Id : AfJVJJaxzJQVQYKC5zwyAm
Power Apps - Building Power Apps
Answered

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

Like (0) ShareShare
ReportReport
Posted on 13 Oct 2021 15:12:34 by

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:
  • Community Power Platform Member Profile Picture
    on 18 Oct 2021 at 17:54:40
    Re: Removing item from a large (over 2k) Sharepoint list in a PA gallery

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

  • WarrenBelz Profile Picture
    148,953 Most Valuable Professional on 16 Oct 2021 at 02:26:03
    Re: Removing item from a large (over 2k) Sharepoint list in a PA gallery

    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
    on 13 Oct 2021 at 23:14:43
    Re: Removing item from a large (over 2k) Sharepoint list in a PA gallery

    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

  • RandyHayes Profile Picture
    76,287 Super User 2024 Season 1 on 13 Oct 2021 at 15:57:44
    Re: Removing item from a large (over 2k) Sharepoint list in a PA gallery

    @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
    on 13 Oct 2021 at 15:30:34
    Re: Removing item from a large (over 2k) Sharepoint list in a PA gallery

    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

  • Verified answer
    RandyHayes Profile Picture
    76,287 Super User 2024 Season 1 on 13 Oct 2021 at 15:21:08
    Re: Removing item from a large (over 2k) Sharepoint list in a PA gallery

    @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.

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 637 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 570 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 473

Loading complete