# \[Solved\] how can I decrement an inventory item stored in google sheets using a barcode scan?

**URL:** <https://community.thunkable.com/t/solved-how-can-i-decrement-an-inventory-item-stored-in-google-sheets-using-a-barcode-scan/1951357>\
**Category:** Questions about Thunkable X\
**Tags:** solved, beginner, help\
**Created:** [July 4, 2022, 1:28pm UTC](https://community.thunkable.com/t/solved-how-can-i-decrement-an-inventory-item-stored-in-google-sheets-using-a-barcode-scan/1951357 "2022-07-04T13:28:00Z")\
**Posts on this page:** 15\
**Page:** 2

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [July 7, 2022, 6:18am UTC](https://community.thunkable.com/t/solved-how-can-i-decrement-an-inventory-item-stored-in-google-sheets-using-a-barcode-scan/1951357/22 "2022-07-07T06:18:34Z")

</div>

Here’s how I would do it:

[https://x.thunkable.com/copy/7ab2ea98368729c65812ac6ed0169760](https://x.thunkable.com/copy/7ab2ea98368729c65812ac6ed0169760)

(See the first screen which has your username on it.)

There used to be a bug with the Get Value block in Thunkable. I don’t know if it has been fixed yet. I noticed that when the inventory value is 1, it doesn’t subtract 1 the next time you click the Scan button.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/1/41a232996d76c5cd087cf525360aa435793f42f5.png)

---

<div class="post-metadata">

**Author:** ![yigitishesabigng](https://avatars.discourse-cdn.com/v4/letter/y/c0e974/32.png) [@yigitishesabigng](https://community.thunkable.com/u/yigitishesabigng)\
**Post date:** [July 7, 2022, 7:59am UTC](https://community.thunkable.com/t/solved-how-can-i-decrement-an-inventory-item-stored-in-google-sheets-using-a-barcode-scan/1951357/23 "2022-07-07T07:59:42Z")

</div>

do I need to give any value to the “scanned barcode” part and the part below it, or can I make a reduction if I make the parts here directly to my code page and get the amount of inventory that matches the barcode directly @tatiang

---

<div class="post-metadata">

**Author:** ![yigitishesabigng](https://avatars.discourse-cdn.com/v4/letter/y/c0e974/32.png) [@yigitishesabigng](https://community.thunkable.com/u/yigitishesabigng)\
**Post date:** [July 7, 2022, 8:36am UTC](https://community.thunkable.com/t/solved-how-can-i-decrement-an-inventory-item-stored-in-google-sheets-using-a-barcode-scan/1951357/24 "2022-07-07T08:36:38Z")

</div>

i have tried the codes, but what I want to do is how to give the number of the scanned barcode to line a, which should appear in front of the user, when he scans, the user will add the barcode by scanning it himself, if I do it according to the list, this will not happen, so I’m wondering if I can do something to scan the data, so the user added 100 products for example, when he entered here, when he clicked the scan button, I want the number of stocks to come according to the barcode he scanned, how should I make changes here (i.e. should I do something to find the row id itself to pull it by the barcode number  
@tatiang

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [July 7, 2022, 2:28pm UTC](https://community.thunkable.com/t/solved-how-can-i-decrement-an-inventory-item-stored-in-google-sheets-using-a-barcode-scan/1951357/25 "2022-07-07T14:28:18Z")

</div>

The project I provided is just a starting point. You should be using variables to store things like scanned barcodes. So yes, you need to replace the sample value I provided with one from the user.

You can look up the inventory value for a specific barcode by looping through the rows of the table (as I showed in the project and if the barcodes match, then display that inventory amount. I think that’s what you are asking. The project already does this, by the way.

---

<div class="post-metadata">

**Author:** ![yigitishesabigng](https://avatars.discourse-cdn.com/v4/letter/y/c0e974/32.png) [@yigitishesabigng](https://community.thunkable.com/u/yigitishesabigng)\
**Post date:** [July 8, 2022, 5:37pm UTC](https://community.thunkable.com/t/solved-how-can-i-decrement-an-inventory-item-stored-in-google-sheets-using-a-barcode-scan/1951357/26 "2022-07-08T17:37:32Z")

</div>

many thanks for your help

---

<div class="post-metadata">

**Author:** ![yigitishesabigng](https://avatars.discourse-cdn.com/v4/letter/y/c0e974/32.png) [@yigitishesabigng](https://community.thunkable.com/u/yigitishesabigng)\
**Post date:** [July 8, 2022, 6:16pm UTC](https://community.thunkable.com/t/solved-how-can-i-decrement-an-inventory-item-stored-in-google-sheets-using-a-barcode-scan/1951357/27 "2022-07-08T18:16:30Z")

</div>

@tatiang  
finally, when I update the number of stocks, the number of stocks remains the number of stocks that came first, even if I go out and enter it comes as the number of stocks that came first, when I press the “-” button, how do I update it, how do I show the number of stocks that have been replenished

i have updated the code structure as follows :

 ![Screenshot_31](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/9/59fc1d8d31d9857a6b58b1dd26109639682f1ba3.png)

---

<div class="post-metadata">

**Author:** ![yigitishesabigng](https://avatars.discourse-cdn.com/v4/letter/y/c0e974/32.png) [@yigitishesabigng](https://community.thunkable.com/u/yigitishesabigng)\
**Post date:** [July 12, 2022, 9:37am UTC](https://community.thunkable.com/t/solved-how-can-i-decrement-an-inventory-item-stored-in-google-sheets-using-a-barcode-scan/1951357/28 "2022-07-12T09:37:06Z")

</div>

when I update the number of stocks I get from the barcode, it doesn’t update the information I get below

code structure :

 ![Screenshot_31](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/9/59fc1d8d31d9857a6b58b1dd26109639682f1ba3.png)

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [July 12, 2022, 10:51am UTC](https://community.thunkable.com/t/solved-how-can-i-decrement-an-inventory-item-stored-in-google-sheets-using-a-barcode-scan/1951357/29 "2022-07-12T10:51:02Z")

</div>

There is an **error** with the `get value` that it uses cache data and therefore does not show updated values in the table.

You will notice that if you exit the app and start it again you will see the values you updated

If you can see this then it means the `get value` error is not resolved yet.

---

<div class="post-metadata">

**Author:** ![yigitishesabigng](https://avatars.discourse-cdn.com/v4/letter/y/c0e974/32.png) [@yigitishesabigng](https://community.thunkable.com/u/yigitishesabigng)\
**Post date:** [July 12, 2022, 11:01am UTC](https://community.thunkable.com/t/solved-how-can-i-decrement-an-inventory-item-stored-in-google-sheets-using-a-barcode-scan/1951357/30 "2022-07-12T11:01:28Z")

</div>

Yes, the inventory amount is updated when I log out through the application is there any chance to update it without logging out of the application? @muneer

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [July 12, 2022, 11:04am UTC](https://community.thunkable.com/t/solved-how-can-i-decrement-an-inventory-item-stored-in-google-sheets-using-a-barcode-scan/1951357/31 "2022-07-12T11:04:12Z")

</div>

Use `get row block instead of `get value` to see the updated information in the required column.

---

<div class="post-metadata">

**Author:** ![yigitishesabigng](https://avatars.discourse-cdn.com/v4/letter/y/c0e974/32.png) [@yigitishesabigng](https://community.thunkable.com/u/yigitishesabigng)\
**Post date:** [July 12, 2022, 11:19am UTC](https://community.thunkable.com/t/solved-how-can-i-decrement-an-inventory-item-stored-in-google-sheets-using-a-barcode-scan/1951357/32 "2022-07-12T11:19:04Z")

</div>

i don’t understand how to use it, I’m sorry if you can give any examples

it would be better if there is a visual example

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [July 12, 2022, 12:41pm UTC](https://community.thunkable.com/t/solved-how-can-i-decrement-an-inventory-item-stored-in-google-sheets-using-a-barcode-scan/1951357/33 "2022-07-12T12:41:30Z")

</div>

In my table (test) I want to show the number saved in column `CodeValue` in the selected row, this is how it is done using `get row` block

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/0/90c914537156bd41c31cfe4d8b9800ad5ff42adc.png)

---

<div class="post-metadata">

**Author:** ![yigitishesabigng](https://avatars.discourse-cdn.com/v4/letter/y/c0e974/32.png) [@yigitishesabigng](https://community.thunkable.com/u/yigitishesabigng)\
**Post date:** [July 13, 2022, 3:43pm UTC](https://community.thunkable.com/t/solved-how-can-i-decrement-an-inventory-item-stored-in-google-sheets-using-a-barcode-scan/1951357/34 "2022-07-13T15:43:11Z")

</div>

thanks for your help, thank you very much

---

<div class="post-metadata">

**Author:** ![tristan.bonnotparent](https://avatars.discourse-cdn.com/v4/letter/t/ad7895/32.png) [@tristan.bonnotparent](https://community.thunkable.com/u/tristan.bonnotparent)\
**Post date:** [July 14, 2022, 10:07pm UTC](https://community.thunkable.com/t/solved-how-can-i-decrement-an-inventory-item-stored-in-google-sheets-using-a-barcode-scan/1951357/35 "2022-07-14T22:07:04Z")

</div>

Hey muneer,  
I’m experiencing the same problem with the get value block. It’s not updating until I close the app. Unfortunately, I’m having the same problem with the get row object block.

Any idea what could cause this?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)\
**Post date:** [October 12, 2022, 10:07pm UTC](https://community.thunkable.com/t/solved-how-can-i-decrement-an-inventory-item-stored-in-google-sheets-using-a-barcode-scan/1951357/36 "2022-10-12T22:07:26Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

[Previous page](https://community.thunkable.com/t/solved-how-can-i-decrement-an-inventory-item-stored-in-google-sheets-using-a-barcode-scan/1951357.md?page=1)
