cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Saaam
Level: Powered On

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

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

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.
Saaam
Level: Powered On

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

Community Support Team
Community Support Team

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.
Saaam
Level: Powered On

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

Community Support Team
Community Support Team

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

Saaam
Level: Powered On

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

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 399 members 2,757 guests
Please welcome our newest community members: