Delete an item from a table using glide delete leaves blank row

I added a delete function to an edit screen. When I delete the record for that row it leaves a blank line in the glide table. Then when I open th elist again there is a blank item listed. This cant be right. Doesnt make any commonsense

Is the table sourced from a Google Sheet? If so, do you have any formulas in that sheet?

As @Robert_Petitto said, this was likely caused by a formula if you’re using Google Sheets. Glide sees the value the formula generated as a valid value to make it a non-empty row. Can you confirm?

No Google Sheet formulae at all.
There are two calculated fields in the table (one template one if then else). One of which contains a value as it includes null value in the Else condition.
Row ID remains in the row. This seems consistent.
I Group by one field so blank row doesn’t show

But this is interesting. If I remove the grouping the blank row appears. If I open it and “Delete Item” again, it now removes the row.

You’re saying that if you have grouped columns then the row doesn’t get deleted? Can you share a screencast/loom of this happening?

No.

On the Item list screen If I group by “Application Status” the blank row dosen’t display because it doesn’t have a value in that field. If I remove the grouping it displays by default in the first position.

Then, if I open the detail screen for the blank record and Delete Item (Again). The row is removed completely. Very strange!!!

Ah…Inline list grouping…not column grouping. got it. Right. Rows without a value for the grouped field won’t display regardless of any other value in that row.

Are you saying that if you delete the row while it’s in a grouped inline list, the row really doesn’t delete but rather just gets cleared?

Haven’t tested extensively, but that’s what happened, but it left the row id in the row

I just delete another item and it removed the whole row. Hmmmm. Don’t like non repeatable issues.

OK. I retested by adding a new row using the app that adds rows. nothing unusual in the data table afterwards.

Then I deleted the item using the Delete Item on the edit screen. Th erow was cleared except for teh RowID

Again, with no grouping set on the Search page the blank item appears at the top.

I delete that item. Viola! Row is fully deleted.

This has to be a bug! It’s predictably repeatable.

Just deleted an item from last row of table. This deletes row, not clears. Seems to be only when you delete an item from within the table not the last item added

And some more information.

The Google sheet has blank rows where items have been deleted. This is regardless of whether I have gone back into the glide app and deleted the blank item as well.

If I then delete those rows from the Google Sheet, the Glide Table losses the plot and wont synch correctly. It either omits items that should still be in the table or in one case it replaced the table with only the omitted items and then synched that back to Google Sheets.

Clearly Delete Item does not work correctly and should be used cautiously.

The google sheet will always contain blank rows in place of where the row was that was deleted. That’s normal. Glide will always ignore completely empty sheet rows.

https://glide-help.zendesk.com/hc/en-us/requests/new

If you can create a video of the problem in action, then I would send it to glide support. This sounds like a bug. I’m not convinced though that this has anything to do with grouping. To make sure, I would leave the list ungrouped, then try to do your initial delete, instead of enabling grouping, deleting, then ungrouping.

I actually created a test sheet and app this morning.

It works perfectly except for the blank lines in the Google Sheet. So it must be peculiar to my specific case. Only problem now is leaving blank rows in google sheet.

Why does Google Sheet have blank rows? This could be problematic for formulae as it can create "VALUE and “REF” results that could disrupt totals for columns etc.

This relates directly to how you construct your arrayformula. You can return a null value if the input is empty, for example.

1 Like

I believe the google API that glide uses does not allow for the entire row to be deleted from the sheet. Only the contents can be cleared, so I think it’s a limitation of the google API. Again, glide ignores empty rows.

1 Like

Thanks Geoff.

I only have one formula that would return an incorrect value if rows empty. Have just sorted a new version that accommodates empty rows so all good

Also, for Thinh, I cant use arrayformula as one of my functions is customer written and does not appear to support array formula references correctly. I overcame that by writing an app script that copies down the formulae each time a new row is added.

Thanks for your help guys.

1 Like

Here’s some sample apps script that can be used to clean up empty rows left by Glide.

Also, unless you absolutely need the computed data in the spreadsheet, I’d encourage you to investigate the option of getting rid of the spreadsheet formulas, and replace them with Glide computed columns.

1 Like

OK Thanks Darren

I had already written script for Deleting.

Instead of using Glide Delete Item I know have a button to Flag for Deletion. This drops “Delete” into a column for the row item and the script runs on a timed trigger to remove rows from the sheet. I run the script against two different sheets and it works perfectly.

Glide formulas are great BUT they don’t handle level of complexity I need in one app unfortunately.

Cheers
Gary

yep, that approach also works :+1:

I’m always up for a challenge, so I’d be curious to learn more about this :slight_smile: