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
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (3,347)