cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Delete rows in Excel

Hi,

 

i'm trying to build a flow that every morning delete rows by 3 until the last rows in a Excel file that is storage on my sharepoint library.

 

How can i do that?

I want to delete multiple rows, now i can only do one.

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Delete rows in Excel

Hi @Saaam ,

 

You could add extra variables and calculate how many rows are in the current table each time it delete a row.

 

Delete a row action is only executed when the number of remaining rows is greater than 3.

13.PNG14.PNG

 

Best Regards,

 

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
Highlighted
Community Support
Community Support

Re: Delete rows in Excel

Hi @Saaam ,

 

If you want to delete the three rows in the table every day, please consider using the following method.

It is worth noting that Delete a row action contained in Excel online connector currently needs to specify the key column. I suggest you select the column with a unique value as the key column, so that only three rows can be deleted every day.

 

  • Initialize variables of type Integer to store the number of deleted rows.
  • Whenever a row is deleted, the variable value needs to be incremented by 1.
  • Before each deletion, it need to determine whether the variable value is greater than 3.
  • A notification can be sent when all rows have been deleted. Set Configure run after, Send an email action is executed only when the Delete a row action fails.

 

Image reference:

30.PNG31.PNG

 

Hope it helps.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Frequent Visitor

Re: Delete rows in Excel

Hi,

i don't have to delete 3 rows.

 

I have to delete rows by the 3rd to the last one.

 

The last one rows is a changeable number.

 

Thanks

Highlighted
Community Support
Community Support

Re: Delete rows in Excel

Hi @Saaam ,

 

Please try this, it is still recommended to use a column with a unique value as the key column.

46.PNG

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Frequent Visitor

Re: Delete rows in Excel

Yes it works but it doesn't stopped.

 

After that the file is clean (only first 3 rows are writed) i have to popolate it with other instruciton (i already did it).

 

How can i tell the cicle to stop when the file is clean?

 

Thnaks

Highlighted
Community Support
Community Support

Re: Delete rows in Excel

Hi @Saaam ,

 

You could add extra variables and calculate how many rows are in the current table each time it delete a row.

 

Delete a row action is only executed when the number of remaining rows is greater than 3.

13.PNG14.PNG

 

Best Regards,

 

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Frequent Visitor

Re: Delete rows in Excel

Flow 1.jpgFlow 2.jpgFlow 3.jpgFlow 4.jpg

 

That's my work until now. It delete everything and then write again. Problem is that it doesn't stoppe, it keep cycling.

I try to remove "Apply each" before the condition but by this way flow delete every row but don't continue with the second part (write).

 

Thanks for your help!

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (8,474)