# Help with inventory app \<\> trebuchet method

**URL:** <https://community.glideapps.com/t/help-with-inventory-app-trebuchet-method/74311>\
**Category:** Ask for Help\
**Created:** [June 22, 2024, 12:30am UTC](https://community.glideapps.com/t/help-with-inventory-app-trebuchet-method/74311 "2024-06-22T00:30:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mauricio\_Gonzalez](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mauricio_gonzalez/32/65524_2.png) [@Mauricio\_Gonzalez](https://community.glideapps.com/u/Mauricio_Gonzalez)\
**Post date:** [June 22, 2024, 12:30am UTC](https://community.glideapps.com/t/help-with-inventory-app-trebuchet-method/74311/1 "2024-06-22T00:30:54Z")

</div>

Hi Glide!

I was looking for some guidance on an inventory app that I am working on.

Context: The inventory app should have a “Product exit” table that logs every time someone takes products out of the inventory for a marketing event, etc.

I used the trebuchet method so that each “Exit” contains a JSON array with:  
{product: 123, qty: 1}, {product:456, qty: 4}

Problem: While the trebuchet method is amazing, I am hitting a blocker because I am not really sure how to calculate the number of products in stock. i.e., how many products are out vs. the ones in the warehouse?

Does anyone have a recommendation on how to tackle this issue?

Problems to solve:

- Understand how many products are in stock vs. outside of the warehouse.
- Once products are back, how to make the calculations so that the products come back as available.

Thanks all!

PD: big thanks to @Robert_Petitto for the trebuchet method. [Here](https://www.youtube.com/watch?v=L1giKujUHxo) is the link in case someone is not familiar with it.

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [June 22, 2024, 12:40am UTC](https://community.glideapps.com/t/help-with-inventory-app-trebuchet-method/74311/2 "2024-06-22T00:40:55Z")

</div>

You might run into character limits at some point, but you might need to

1. Create a helper table that looks up ALL json exits. Use a JSON Object column that create an array from the lookup.
2. Bring that array into your products table
3. Create a JSONata query in a template column that you’ll use in a Query json column that will roll up how many product has exited the system. (I use ChatGPT for this)
4. Use a math column to see how much product is remaining

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [June 29, 2024, 12:41am UTC](https://community.glideapps.com/t/help-with-inventory-app-trebuchet-method/74311/3 "2024-06-29T00:41:07Z")

</div>

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