Yes! “A” native Glide plus/minus solution is here! Thank you Glide team!

Mission: Increase/decrease item qty by staying on the item, but when QTY reaches 0, remove item!

Use case?

• Primarily, shopping carts but other uses too.

Some context first.

PRE-CUSTOM ACTION DAYS

It’s October 2020. X has added 3 items to wish list (cart). The flow is as follows (with individual variations, but whichever variation was deployed the outcome was nearly always the same):
• Select item> increment>go to cart>either decrement and/or remove item
• Select item > go to cart > increment/decrement/remove item.
• Some carts didn’t even let poor customer remove an item once selected.
• Made no difference whether we used a script, as script cleared entire order associated with an email. We were not targeting individual rows based on complete/in-progress.
• Introduction of Joined list –new life, as we all know, was injected into the Shopping cart.
• Introduction of twin buttons for +/- (they either don’t work or are not officially supported by Glide).

POST 17 NOV 2020 -
Watch the video (dark mode so you get a clear picture): What’s happening?

How to create your own plus/minus button.
• You have an orders sheet?
• Go to the editor, and create a USP Boolean- let’s call it the “decrement Boolean (“DB”) ”
• On the cart tab, tap open the inline list containing all you items, and set the layout to “Checklist”.
• Pull “DB” as the check value. This is no ordinary Boolean. It is your +/m Boolean.
• Open CNA
• Start action >
(1) if DB is not true>increment Qty by 1:
(2) if DB is true > decrement qty by -1:
(3) if DB is true & qty = 0, then view details of orders sheet.
(4) Give it a name, and save. Then return to the Cart.

Q. Why did I use a false value to increment, and not decrement?

The logic is quite simple. When customer goes to the cart, having viewed and selected the items, the first natural thing to do is to add qty. I wanted to maintain the flow. So I selected a false value for +, but if they wanted to decrease Qty to ask them simply to check the false value to turn it to a true –(minus) value, and then just keep tapping on the same item until they reached their desired number.

My next worry was I did not want them to get pass the Cart with items with a 0 qty value. Just doesn’t look nice on the final order. Hence, the 3rd condition. So as soon as qty reaches 0, the delete item page opens, prompting them to remove the item. Of course you would need to set the checkout visibility to when qty is not 0 (I will let you work it out)!

If it makes a difference, great!

If it doesn’t, sorry!

3 Likes

Okay Looks like the clear value is another name for reset.

Here is another demo that clears the item when the value reaches 0.

Pitfalls to avoid:

If you try clearing USC values the row ID remains on the sheet. Depending on use case, you might be able to avoid it altogether.

This morning I changed the US Boolean to a normal one to see if I could carry out multiple actions on a single row:

Here is the video:

Don’t worry if it looks like a script in the background; my net is a bit a slow today, that’s all.

  1. When person X selects an item, the item is added via “add row”>show notification.
  2. Incre-decrementation is of a non-US Boolean on the same row.
  3. When item reaches 0, it is removed from the cart. I did this by setting “set column” to “this item” .

This was a demo of how to carry out 5 sequential actions on the same row/item .

  1. Add row (to add item)
  2. Increment item +
  3. decrement item -
  4. set column (to remove item)
  5. clear/reset value/item/row/column

Edit

when an entire row of data is cleared, the row remains as is. In fact, the sheet keeps adding new rows. Values are cleared, but not the row. Two consquences:

  1. If a row usage is of concern to you, then you will need to manually delete the de-populated row.
  2. Chances of a cleared row reappearing on the tab on a scale of 0-5 is 5, unless the app is refreshed.

I think that’s all new important releases wrapped in a small demo.

Over to you guys.

Thank you

2 Likes