đź’« The Trebuchet Method

In certain situations, a single column has the potential to replace an entire table of data.

The Trebuchet Method allows you to create an inline array that allows you to create a SIMPLE one-to-many relationship between two sets of data without the need of a log or submissions table.

Examples:

  • Who owns which item
  • Who has registered for an event
  • Who has completed which task

Pros:

  • no app bloat
  • no additional rows of data
  • fairly easy to set up

Cons:

  • Can only track one data point (eg. who has which item, but not when, how many, etc.)

Take a look at the video tutorial below to learn how leverage this powerful technique in your own app:

Thanks to @Lucas_Pires for his innovation and for coining the term “trebuchet”.

EDIT:
I’ve created a new way to trebuchet!

8 Likes

This is really cool @Robert_Petitto, and could really save me a bunch of rows…
However I have an additional dimension I can’t figure out.
Say I have 10 different classes that each occur every week for 5 weeks.
So I’d like to which users checked-in into each class every week. I thought I could just have 5 columns for each week, but how do I go about selecting the right column each week to collect check-ins ?

Also, isn’t there a risk if several users change the Trebuchet column at the same time, that some data could be lost ?

I mean another user could override the comma separated owners column in between the time you read it and make your own override ?

You’re right on both of your posts.

  1. The trebuchet method isn’t designed to handle two related data points (in your case user AND week). The best you could do is to have a go between sheet of weeks. You’d need each of the 10 classes per week (50 rows). Then, you’d write the checkins on the appropriate row.
  2. The trebuchet does have a gap where two users could attempt to write at the exact same time. Most of the time it’s harmless and one user will just have to click a button twice to see you there change take affect. Some more critical situations in terms of assigning doctors to patients or for time sensitive recordkeeping, youd definitely want to use a log rather than the trebuchet method.
1 Like

It’s possible to work around this by delegating the update to a 3rd party, eg. Make.

Make ?

Otherwise known as Integromat.
So instead of a Set Column Values, you trigger a webhook with an appropriate payload and do the update with Make (either in the Google Sheet or via the Glide API). This way, you can ensure that updates are serialised and no collisions can occur.

Btw, there’s got to be a limit in the size of a text column, right ?

Yeah, 1MB.

So roughly 1 million characters, depending on encoding.

1 Like

If we use Make, it still means that two users might send two different “owners+me” lists to update the cell of owners.
How does using a 3rd party resolves this?

Make would keep its own copy of “owners” in a Data Store, and then just add “me” one at a time.

1 Like

Ha, I see- got it. Thanks.

Hey @Robert_Petitto, have you ever run into lags when using the trebuchet method?

I had setup a multi-state button block (e.g. Want and Don’t Want) using trebuchet, there was no lag for a long time. But all of sudden, it started to lag after yesterday.

I am trying to find the cause for this lag, maybe because I upgraded to the new reusable actions? Curious if you have any quick solve for this. Thanks!

UPDATE: Found the problem, if you enabled Recent Runs in new Actions tab, it’s causing serious lag for trebuchet method.

Interesting. Good to know and probably shouldn’t be the case. @Mark @Jason ?

is this replaced with the data structures integration and set modifiers?

It can be! I also found that using a multiple files column + make array column + remove element column works quite nicely as well.

I’ll be sure to make a new video.

1 Like

I started using the add/remove element for social like/follower lists, then using ai to convert to a list I can relate (is there another way to convert json to lists?). looking forward to the new video. you’re the man Robert :slight_smile:

This sounds like sth JavaScript can do, maybe you can ask ChatGPT to write a function for you?