cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
william_wallace
New Member

How can I delete "X" rows at top of Excel Table?

Hi Experts,

I have an Excel Online for Business Spreadsheet Table that is updated by Power Apps and I need a flow to remove rows from the top of the table.

I need to find total number of rows ("X"), then

("X" - 1500) = "Y", then

Delete "Y" number of rows at top of table.

 

Can this be done in Power Automate and have it run when table reaches < 1500 rows?

I'm new to Power Platform and just need a little guidance.

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @william_wallace :

Cause Power Automate can only delete one row at a time, you should create a loop to delete rows one by one.I suggest you use the Remove function of Power Apps to delete records in batches.

1\Set the 'Data row limit' to 2000

 

vbofengmsft_0-1629165025345.png

2\Add a button and set it's OnSelect property to:

 

Remove(TableName,FirstN(TableName,30)) /*Delete the top 30 records of the data source*/

 

Note:If there are many records to be deleted, this command will take a long time to execute

Best Regards,

Bof

View solution in original post

2 REPLIES 2
v-bofeng-msft
Community Support
Community Support

Hi @william_wallace :

Cause Power Automate can only delete one row at a time, you should create a loop to delete rows one by one.I suggest you use the Remove function of Power Apps to delete records in batches.

1\Set the 'Data row limit' to 2000

 

vbofengmsft_0-1629165025345.png

2\Add a button and set it's OnSelect property to:

 

Remove(TableName,FirstN(TableName,30)) /*Delete the top 30 records of the data source*/

 

Note:If there are many records to be deleted, this command will take a long time to execute

Best Regards,

Bof

takolota
Super User
Super User

@william_wallace & @v-bofeng-msft 

 

Check out the new Excel Batch Delete template. It can handle your request in under 30 seconds with less than 8 actions.

https://powerusers.microsoft.com/t5/Power-Automate-Cookbook/Excel-Batch-Delete/td-p/1634375

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (4,236)