I’m working on a quoting calculator for my friend junk removal business and, as it’s currently not going to record the quote and just be a reusable calculator, I’m trying to create a single button at the bottom that resets all of the values (all rows) of a single column (“QTY” aka quantity) in each of two collections/sheets. Frankly, there’s some things I don’t understand.
My current solution is to create an action/reset-button on each item in the collections, using the “Set Column Values” and setting QTY at 0. This is aesthetically messy with all the buttons on each one and also pretty cumbersome functionally having to press all the ones that have values every time, rather than just one.
In my mind for UI within glide, it seems like I should be able to at least link to a specific row here. How do I know what this is connected to, or change it for that matter? Which item is THIS ITEM?! (it even has the option to “search items”, yet only “this item” exists). On that note
even though there are two entire collections on the screen, and the button is not a part of either them is specifically changes the first item in the first collection.
I asked the Glide AI and this the answer it gave me:
First, I want to make it clear that you can not natively do a Set Column action on multiple rows. The only thing you can do against multiple rows is a Delete Row action.
‘This Item’ is the current row attached to the screen you were viewing when you clicked on the button.
To add to what @Darren_Murphy shared, that method should work, but since your are dealing with quantities instead of true/false, like that example is doing, you may need some additional logic, after you reset the rows, to reset quantity for a row when you click on, or make a change, in that row. So you would do a Set Column to zero before adding the quantity. This would happen when you set a new Unique ID to mark a row as selected.
I’ll also mention that the Reset Rows method mentioned above is a precursor to this example below, which does deal with quantities, so may be a better example to look at.
I got this part, but what indicates & decides what “this item” is when there’s two collections on the screen, and the button with the action that connects to it is at the bottom of screen, out of both collections? Aren’t they all attached to the screen? Does it just choose the first one?
I’m still learning Glide and it’s glossary of terms, so I"ll try to make sense of this and see if I can figure it out Thanks for the guidance
A detail screen is always attached to one row in one table…regardless of how many collections you have on that screen. It’s the row that the ‘Screen’ is attached to. The button on the screen is related to the screen itself and determines what ‘This Item’ is related to. It has nothing to do with the collections because the button is a separate component apart from the collections. You need to check which table the screen is attached to. If you don’t have any filters or row owners, then the screen will usually be attached to the first row in the table. If you do have that screen filtered, or have row owners in the table, then it will be the first row that matches the filter or row owner. If you navigated to that screen from a collection, then that screen will be attached to the row you selected. It has nothing to do with the collections you added to the screen, or where you placed the button on the screen. The button is part of the screen, and ‘This Item’ will relate to the row that the screen is attached to.