# 💫🪗 JSON Trebuchet

**URL:** <https://community.glideapps.com/t/json-trebuchet/72744>\
**Category:** Community Resources\
**Tags:** tutorial\
**Created:** [April 19, 2024, 10:57pm UTC](https://community.glideapps.com/t/json-trebuchet/72744 "2024-04-19T22:57:20Z")\
**Posts on this page:** 20\
**Page:** 1

<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:** [April 19, 2024, 10:57pm UTC](https://community.glideapps.com/t/json-trebuchet/72744/1 "2024-04-19T22:57:20Z")

</div>

# 👋 Hey fellow Gliders!

Part two of my Trebuchet series is live!

Last week, I posted a tutorial on a new way to create inline arrays using the Trebuchet method

> [@dizzy A NEW way to Trebuchet!](https://community.glideapps.com/t/a-new-way-to-trebuchet/72402):
>
> wave Hey fellow Gliders! If you haven’t heard of the Trebuchet method, it’s a term coined by @Lucas_Pires that refers to creating inline arrays. Inline arrays can be an efficient way to create relations without requiring a helper table thereby preserving your row count! Previously, the Trebuchet method required about 6 columns and 2 custom actions (4 updates to add and remove a single item). This new version of the Trebuchet method cuts that usage IN HALF star_struck (3 columns, 1 action). …

Part 2 is a deep dive on how you can Trebuchet more than a single value by creating **arrays of JSON** 🤯.

Check out how to build an inventory ordering app using the JSON Trebuchet Method!

### 🍿Enjoy!

[![](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/c/b/cb2489fa94995be9c0dccebee67c425371bb6c9e.jpeg "Glide: Build an Inventory Ordering App Using the JSON Trebuchet Method") ](https://www.youtube.com/watch?v=1QbKTccN850)

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [April 20, 2024, 2:23am UTC](https://community.glideapps.com/t/json-trebuchet/72744/2 "2024-04-20T02:23:52Z")

</div>

Box office stuff every week.

Maybe I’ll just call it Bob office from now.

---

<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:** [April 20, 2024, 4:10am UTC](https://community.glideapps.com/t/json-trebuchet/72744/3 "2024-04-20T04:10:10Z")

</div>

I’m trying to get back into a cadence of one video every 2 weeks or so 😅

---

<div class="post-metadata">

**Author:** ![tuzin](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/tuzin/32/86077_2.png) [@tuzin](https://community.glideapps.com/u/tuzin)\
**Post date:** [April 20, 2024, 5:36pm UTC](https://community.glideapps.com/t/json-trebuchet/72744/4 "2024-04-20T17:36:34Z")

</div>

Great stuff. 45 minutes that can save thousands of rows. Thank you!

---

<div class="post-metadata">

**Author:** ![Keith\_Chikumbirike](https://avatars.discourse-cdn.com/v4/letter/k/5daacb/32.png) [@Keith\_Chikumbirike](https://community.glideapps.com/u/Keith_Chikumbirike)\
**Post date:** [May 22, 2024, 10:23am UTC](https://community.glideapps.com/t/json-trebuchet/72744/5 "2024-05-22T10:23:24Z")

</div>

Simply amazing, thank you so much…

Is it possible to make and distinguish orders for different projects?

If possible, what would be they best way to stucture the work flow as I’d like to use this method to create order lists for different projects from a project tab (and inside a specific project)

Thanks in advance

---

<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:** [May 27, 2024, 3:42pm UTC](https://community.glideapps.com/t/json-trebuchet/72744/6 "2024-05-27T15:42:54Z")

</div>

Orders as in “sequential order” or orders as in requests/cart items?

---

<div class="post-metadata">

**Author:** ![Keith\_Chikumbirike](https://avatars.discourse-cdn.com/v4/letter/k/5daacb/32.png) [@Keith\_Chikumbirike](https://community.glideapps.com/u/Keith_Chikumbirike)\
**Post date:** [May 27, 2024, 6:21pm UTC](https://community.glideapps.com/t/json-trebuchet/72744/7 "2024-05-27T18:21:19Z")

</div>

Orders as in request /cart items.

Each cart being unique to a particular project and user can always return to project and edit or delete cart items as need be when project is still work in progress.

I had envisioned a work flow in which user opens a project and from within that particular project he can then add items (like shopping for project components and qty) using this trebuchet method…

---

<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:** [May 27, 2024, 8:11pm UTC](https://community.glideapps.com/t/json-trebuchet/72744/8 "2024-05-27T20:11:27Z")

</div>

Got it. Ya—should be doable. You’d need to reference the project you’re currently viewing in order to dynamically display the current screen’s project order items.

I reference this method at 07:30 here:

[![](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/e/6e4fb46c6a5443122e76b33f1dece22645baba0e.jpeg "Glide: Prefill a Form by Scanning a QR Code") ](https://www.youtube.com/watch?v=ERVxDnpn4lU)

---

<div class="post-metadata">

**Author:** ![Myles\_Chaput](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/myles_chaput/32/62176_2.png) [@Myles\_Chaput](https://community.glideapps.com/u/Myles_Chaput)\
**Post date:** [May 28, 2024, 3:29pm UTC](https://community.glideapps.com/t/json-trebuchet/72744/9 "2024-05-28T15:29:51Z")

</div>

Definitely bookmarked for a when we can watch next situation!

---

<div class="post-metadata">

**Author:** ![Keith\_Chikumbirike](https://avatars.discourse-cdn.com/v4/letter/k/5daacb/32.png) [@Keith\_Chikumbirike](https://community.glideapps.com/u/Keith_Chikumbirike)\
**Post date:** [May 29, 2024, 9:36am UTC](https://community.glideapps.com/t/json-trebuchet/72744/10 "2024-05-29T09:36:20Z")

</div>

Thank you so much, but i cant seem to figure out how…

I’ve been trying since you made reference to the video but once I open the collection of items to add to project, the project ID in the url is lost.

I have also tired a sequence of actions in which one of them is copied to clip board and I copy the project ID but how do you then paste into the desired column?

Perhaps my setup is complicated all together? The tibuchet method really got me excited as a great way to save up on rows but harder to execute than I thought (I’m more or less a beginner with lots to learn)

---

<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:** [May 29, 2024, 10:26am UTC](https://community.glideapps.com/t/json-trebuchet/72744/11 "2024-05-29T10:26:28Z")

</div>

How are you configuring the collection of items? What’s the source? The entire table of items with a filter or as a relation or related items?

---

<div class="post-metadata">

**Author:** ![Keith\_Chikumbirike](https://avatars.discourse-cdn.com/v4/letter/k/5daacb/32.png) [@Keith\_Chikumbirike](https://community.glideapps.com/u/Keith_Chikumbirike)\
**Post date:** [May 29, 2024, 12:19pm UTC](https://community.glideapps.com/t/json-trebuchet/72744/12 "2024-05-29T12:19:00Z")

</div>

I actually tried the whole table as well as a relation…  
Whats the best method here?

I currently have a relation to the order items in the projects table, then in the projects tab, I view the items as a collection from that relation.

But when I want to add a specific item and its quantity to a list, I’m forced to have data write to the order items without a way of carrying the Project ID. If I use the url method, the url would have changed

---

<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:** [May 29, 2024, 2:24pm UTC](https://community.glideapps.com/t/json-trebuchet/72744/13 "2024-05-29T14:24:30Z")

</div>

> [@Keith\_Chikumbirike](#):
>
> I currently have a relation to the order items in the projects table, then in the projects tab, I view the items as a collection from that relation.

This is the best way because then the project ID is a part of the deeplink and can be queryable.

---

<div class="post-metadata">

**Author:** ![Krivo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/krivo/32/5363_2.png) [@Krivo](https://community.glideapps.com/u/Krivo)\
**Post date:** [June 11, 2024, 5:51pm UTC](https://community.glideapps.com/t/json-trebuchet/72744/14 "2024-06-11T17:51:13Z")

</div>

@Robert_Petitto  
Isn’t a bit risky to base a production app on a column type like ‘multiple files’ which is really designed for something quite different.

If many many rows are condensed in a single cell then Glide could get more restrictive on such a column type as it potentially makes the app developers use a lower tier. What’s your thought on that @NoCodeAndy - would you say it is safe to build an app based on the multiple files column as shown in the (not needed to say) very clever app

---

<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 11, 2024, 8:17pm UTC](https://community.glideapps.com/t/json-trebuchet/72744/15 "2024-06-11T20:17:41Z")

</div>

It depends what you’re using it for. It isn’t a crazy scalabale solution. It’s always better to add rows and make relations to the rows.

---

<div class="post-metadata">

**Author:** ![Keith\_Chikumbirike](https://avatars.discourse-cdn.com/v4/letter/k/5daacb/32.png) [@Keith\_Chikumbirike](https://community.glideapps.com/u/Keith_Chikumbirike)\
**Post date:** [June 14, 2024, 12:40pm UTC](https://community.glideapps.com/t/json-trebuchet/72744/16 "2024-06-14T12:40:04Z")

</div>

Im using it for:

1. a project managemnet app in which the project manager want to add a couple of items to his project…

---

<div class="post-metadata">

**Author:** ![NoCodeAndy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nocodeandy/32/62530_2.png) [@NoCodeAndy](https://community.glideapps.com/u/NoCodeAndy)\
**Post date:** [July 12, 2024, 2:06pm UTC](https://community.glideapps.com/t/json-trebuchet/72744/17 "2024-07-12T14:06:03Z")

</div>

> [@Robert\_Petitto](#):
>
> It depends what you’re using it for.

I agree with this. Specifically: what’s the app used for?

I might not use the trebuchet method with a business-critical operations system, but I might use it with a smaller utility app or one-off event app.

The decision comes down to a couple things, IMO:

a) What’s the implication if it breaks?  
b) How much work will I need to do to revise the app?

---

<div class="post-metadata">

**Author:** ![Mike\_Met](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mike_met/32/62227_2.png) [@Mike\_Met](https://community.glideapps.com/u/Mike_Met)\
**Post date:** [May 5, 2025, 12:14pm UTC](https://community.glideapps.com/t/json-trebuchet/72744/18 "2025-05-05T12:14:47Z")

</div>

@Robert_Petitto hey, thanks for the tutorial, it’s been super helfull - I’ve managed to create an ordering system, but would like to turn it into a marketplace ordering system.

1. Customer adds items from multiple distributors to cart (done)
2. Group cart items by distributor (done)
3. Sends email with filtered order items to each distributor when user submits order (stuck)

From what I can find, the suggestions are to either have a order\_group helper table or make a bunch of single value columns and look up the distributor for each item.

Would love some ideas.

Thanks,

Mike

---

<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:** [May 5, 2025, 12:51pm UTC](https://community.glideapps.com/t/json-trebuchet/72744/19 "2025-05-05T12:51:00Z")

</div>

Hi Mike,

Seems like a “Manual Trigger” workflow (now available as a preview feature) would suit your needs. When an order is placed, trigger the workflow.

The workflow (not sure how the JSON is set up, but potentially):

- Loop through JSON array

---

<div class="post-metadata">

**Author:** ![Mike\_Met](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mike_met/32/62227_2.png) [@Mike\_Met](https://community.glideapps.com/u/Mike_Met)\
**Post date:** [May 5, 2025, 1:15pm UTC](https://community.glideapps.com/t/json-trebuchet/72744/20 "2025-05-05T13:15:21Z")

</div>

Thanks for the quick response. I’ll try that - JSON setup is still WIP, but haven’t changed the orderId column other than add in the distributor that’s linked to the product being, so will need to loop through all items by distributor to trigger mails. Trying to avoid creating extra tables for order\_groups

[Next page](https://community.glideapps.com/t/json-trebuchet/72744.md?page=2)
