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 / Issue with deleting re...
Power Apps
Answered

Issue with deleting records with large data via collection

(0) ShareShare
ReportReport
Posted on by 149

Hi,

I have a SharePoint list with over 2000 records. My App is a scheduling app which records each day of a class being taught per line, therefore having its own ID number.

 

I collect the data using the following first, as I have to perform various filters.

/*Collect more than 2000 rows by concat two collections*/
ClearCollect(colC,Sort(Timetable,ID,Descending));
ClearCollect(colD,Sort(Timetable,ID,Ascending));
ClearCollect(Timetable_Collection,AddColumns(colC,"START",DateTimeValue(EventStart,"en-GB"),"END",DateTimeValue(EventEnd,"en-GB")),AddColumns(Filter(colD, !(ID in colC.ID)),"START",DateTimeValue(EventStart,"en-GB"),"END",DateTimeValue(EventEnd,"en-GB")));
Clear(colC);Clear(colD)

 

I am then using Timetable_Collection as my main data source to perform filters etc.

There is also a manual editable form I have in which I collect all the events for a particular class and display in a form.

The idea is to be able to delete each record individually or as a whole.

Originally, when my data set was less than 2000, the delete record work perfectly. But since it went above 2000, the delete is not working at all.

The code for deleting record is:

Select(Parent);
Remove(testCollection,ThisItem);RemoveIf(Timetable,ThisItem.ID = ID)

I collect all events with the same 'Title' under testCollection and try to compare the ID with the original SP List ID.

 

Any ideas how I can get this to work again?

 

Thank you,

Mo 

Categories:
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @Mo_Islam 

    Try re-writing your RemoveIf like this

    RemoveIf(Timetable, ID = Value(ThisItem.ID))

     

    I just tested this on a List I have with more than 2000 items and it worked.

     

  • Mo_Islam Profile Picture
    149 on at

    Hi. Thank you for your suggestion. I tried that too but it didn't work.

    I ended up using a flow instead, with the trash can icon as a trigger.

  • Verified answer
    Mo_Islam Profile Picture
    149 on at

    Th Solution that worked for me is as follows:

    I created a new flow with PowerApps as the trigger:

     

    Mo_Islam_0-1605211256761.png

    On the trash icon, the formula I used is, where you call the Flow from Action --> Power Automate then select the flow created.

    DeleteTimetableRecord.Run(galleryClassEdit_New_1.Selected.ID);

     

    Hope this helps for others looking for a solution if the solution by @Anonymous does not work.

     

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @Mo_Islam 

    Seems odd to me that you had to use Flow for something that can be done in PowerApps. Makes me think something else is going on here.

     

    Well done on getting a solution though, because that's what are all about with our App builds 😄

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

#2
WarrenBelz Profile Picture

WarrenBelz 207 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 169

Last 30 days Overall leaderboard