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

Google Sheets - deleting multiple rows

I am having trouble deleting rows in a Google aheet using Flow. I can "get rows" successdully, but the flow errors on the next step of "delete row" (for each) ... I can't figure out what to put in row Id so that it doesn't error. Any pointers appreciated!

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Re: Google Sheets - deleting multiple rows

Hi @Pdam,

 

For the Row ID field, input the dynamic content "PowerApps id" in this field should work.

23.PNG

 

If you have any further questions on this issue, please post back.

Regards

 

 

Community Support Team _ Michael Shao
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

4 REPLIES 4
Community Support
Community Support

Re: Google Sheets - deleting multiple rows

Hi @Pdam,

 

For the Row ID field, input the dynamic content "PowerApps id" in this field should work.

23.PNG

 

If you have any further questions on this issue, please post back.

Regards

 

 

Community Support Team _ Michael Shao
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

Pdam
New Member

Re: Google Sheets - deleting multiple rows

Thank you for the assist - this worked a treat! I am just dipping my toes into Flow and it has the makings of a great business user tool and a quick and simple integration widget.

Thomas Resolver I
Resolver I

Re: Google Sheets - deleting multiple rows

That doesn´t work with more then ~10-20 rows!

It seems that the ID´s were changed during the deletation. Or some caching mechanisms took place.

The FOREACH-Loop starts with the first row, which is in general a bad idea. All further lines will now move up a row.

Having 220 rows to delete, will create errors on line: 22, 25, 29, 41, 43, 44, 47, 52, 61, 62, 63, 66, 73, 78, 84,..... and so on.

{ "status": 404, "message": "The line with the key \"824b9845d6294096828b1fb9e848e550,85\" was not found.\r\nclientRequestId: 8df6361b-fd32-44b1-8d49-b148761c444e", "error": { "message": "The line with the key \"824b9845d6294096828b1fb9e848e550,85\" was not found." }, "source": "googledrive-we.azconn-we-01.p.azurewebsites.net" } 
I´ve alternatively tried to delete and create a new sheet, but that is not possible due to the lack of connectors.
Currently, I have not found a suitable solution to copy all rows from an Excel-Sheet on a OneDrive 4 Business
to a Google Sheet.
 
It doesn´t matter using a Flow or a LogicApp, tried both.
 
It´s simple as that:
LogicApp Google Sheets.png

 

 

Thomas Resolver I
Resolver I

Re: Google Sheets - deleting multiple rows

My assumption was right!

You can solve the deletation issue by iterating backwards:

LogicApp Google Sheets For.png

 

Declare two variables: The maximum number of rows and the current row.

Set the max row -1 to the current row.

Use an Until-repeater where the current row equals zero.

Then delete this very row and reduce the current row counter.

 

body('Zeilen_abrufen')?['value'][variables('RowCounter')]?['__PowerAppsId__']

That´s it!

Now you have to keep an eye on the max. amount of calls to the Google Sheets-Connector. It might happen, that you have to wait for several seconds after a couple hundred calls (Deleting and adding combined).
But that is another topic 🙂

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

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!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Users online (7,511)