Clear Whole Column PLEASE‼️

Can we PLEASE get a feature for clearing an entire column of data without having to resort to webhooks (this is supposed to be a no-coder friendly service for crying out loud). We shouldn’t have to resort to any “trickery” or “workarounds” either. Not all of these tricks work for all scenarios anyway, and most are pretty tedious if you have a fair number of rows you are clearing in that column.

With all the gloriousness that is Glide, WHY is this not a feature??? We get so many amazing things, but this seems like such a basic thing to overlook… Is there a reason???

Its possible that you are misunderstanding the structure of a database in general. Each row should be considered a sacred piece of data, a stand alone entity, deleting one column in a row, should not effect the entire database. You need to iterate over the rows to delete each column for a reason.

Maybe you could help us by explaining your use case and possibly there is a better way?

I’m not asking to delete the column, just to clear the contents of the column…

I’ve run into this issue on a few projects, but currently I’m working on a till system that the concession workers at the school I work for can use to track purchases at the concession stand and keep track of the drawer balance among other things.

I have a table where each transaction is logged (call it table 1), but in order to make the layout aesthetic I am trying to use a card component inside the form container that logs the transactions. This card component references a second table (table 2) that has menu items, their prices, and an icon for the item in list format. These icons in a card component are meant to make it easier for the high schoolers that will be working the stand to input an order. The idea is to click on an item or items which increments a number for that item in the table where the icon’s are stored. Through a series of relations, when they submit that transaction to table 1, it logs the values from the quantity field on table 2 to the respective quantity tables in table 1.

The problem is now I need to reset the quantity fields in table 2 back to zero to prepare for the next transaction. I can’t automate this without using a webhook which isn’t feasible on a usage basis and potential overage of use on the free plans for the webhook integrations.

My only option is having a “Reset Item” button below the component that clears the value in that row for that item. This works, sure…but it’s not feasible for them to have to scroll through and reset “X” number of items each time they make a transaction. It doesn’t make sense in the fast paced setting they deal with.

A simple “Clear Column” to empty the data in that column would make this and other scenarios similar to it so much easier and user friendly.

You will need to create a relation/query to lookup the items that are in the “cart” on your table that the screen is built on, then you can use a workflow to loop through and clear them all at the same time. Its also possible for you to tie the “cart” to that user table so that in the event that multiple users are logged in that will allow for multiple checkouts.

In your workflow target the edit column data, and point it to your query, also its possible depending on how you’ve built the app that a seperate table for the “cart” is the best practice

I have a mostly simple solution, but it most definitely is a workaround. I used to have a shopping cart concept app several years ago that pretty much did the exact same thing you are trying to do. Item quantities were incremented within the item rows themselves. A single button click would “reset” all item quantity values in one shot with a little smoke and mirrors.

People usually get upset when I offer workarounds in their feature requests, so I’ll leave it up to you if you are interested or not. Maybe you’ve come across my method in other posts.

While I do agree with your request and would love to see it happen, it’s been a long standing request of Glide since the beginning. Ability to "Set columns", "Increment" and "Delete Rows" via multiple relations There are times when I just cannot wait for a feature requests to come to fruition, so I have to settle for a NOW solution.

2 Likes

I’d like to see your workaround if it’ll help get me by.

This is the concept.

This is a working copyable template. Not exactly a replica of what you want, but enough to get an idea of the fundamentals. You’ll probably want to copy the template because I didn’t think it works correctly in the preview.

I do actually have a copy of my shopping cart concept, but it was auto converted from a classic app, so it’s current missing some key functionality. If I have time in the next day or two, I’ll try to rework it and share a template of it.

Here’s what I’m thinking for your app:

First question I have, is if your users are signed in or not. If they are, you can utilize the user profile for some of this. If not, we’ll just need to utilize the parent table for your screen.

What you need is a new basic text column in the user table or the screen table. Let’s name it RootID. If you are using the screen table, make sure it’s a user specific column if multiple users are using the app. It does not need to be user specific if you are using the user table as each user will have their own row and will not be sharing the same row/column cell.

You will need a button with a set column action to write a Unique ID to that RootID column. This button will be your Clear/Reset button.

In your items table, add a Single Value column to display that RootID across all rows in the table.

In the items table, add a user specific basic text column and name it SelectedID.

In the items table add an IF column that compares the RootID to the SelectedID. If they match, then return you quantity column, else return 0 or blank. This is what you will display for quantity in your collection.

Change the click action in your collection to a workflow. You will want an IF branch in the workflow that checks if RootID matches SelectedID. If it does match then you only need to increment the quantity by 1. Else, if it doesn’t match, first write the RootID to the SelectedID column, followed by setting the quantity column to 1.

Your Reset Item button shouldn’t need to change.

Whenever you click the Clear/Reset button to reset everything, it will change the RootID, which will update the Single Column value on all rows and will no longer match the SelectedID, so everything will appear to be cleared because if the IF column that returns quantity or zero/blank.

For the rest of your logic to calculate the final totals and whatever else you store, you will need to include the checks to only include items where RootID matches SelectedID AND Quantity >= 1.

That should be about it. The main Clear/Reset button changes a value in a single row, but affects all of your item rows without actually updating any data in those rows. That’s the smoke and mirrors part.

1 Like

That makes sense in my head while reading it and I think that will work just fine for what I need. I’ll play around with it when I come back in next Monday. We are about to shut down for the holiday this week. Thank you so much Jeff! I’ll be sure to bother you again if I run into issues implementing it next week.

1 Like