cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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

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
Community Support
Community Support

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.

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

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.

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

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

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

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