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

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

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

(0) ShareShare
ReportReport
Posted on 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:
I have the same question (0)
  • Verified answer
    RandyHayes Profile Picture
    76,291 Super User 2024 Season 1 on at
    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.

  • Community Power Platform Member Profile Picture
    on at
    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

  • RandyHayes Profile Picture
    76,291 Super User 2024 Season 1 on at
    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 at
    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

  • WarrenBelz Profile Picture
    151,875 Most Valuable Professional on at
    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 at
    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!

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 714 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 419 Super User 2025 Season 2

#3
developerAJ Profile Picture

developerAJ 243

Last 30 days Overall leaderboard