Associate multiple rows from one table to another using checklist?

Getting back to your question about using checkboxes, I think you may struggle there because there is no way to dynamically add/remove checkbox components. So unless the number of items is fixed, I don’t think that will be possible.

But you could “fake” it by using an inline list and style it to look like checkboxes. Tapping an item in the list would fire an action to add a row with the correct values. I’m pretty sure that would work, I’ll see if I can make an example.

So I was able to achieve the Items belonging to multiple Buckets with this technique! However, I had to use choice list to select the item, and I could only add one item at a time.

Link to Google Sheet
Link to Demo App

However, now, the problem is:

  • I don’t know how to remove the item(s) from the buckets
  • I don’t know how to make sure only the items not yet added to the bucket are shown as options for what can be added. (Which means I could have many duplicate entries to the ItemsToBuckets sheet)
1 Like

I just managed to do it withe a choise component. But you have to add one by one with a choice component.

I think to implement your solution glide needs an iterator action that runs over all selected items and add a new row for each iteration.

1 Like

How do you keep track of the categories an item belongs to? Did you create a separate sheet like the solution described above? Or is there a different way?

Yes I use a seperated sheets where i use the row id as foreign key.

If you google for sql n:m relations you find some nice images describing that.

The tricky part is to show only the items that are left to add in the choice component.

1 Like

Cool!

So I was able to do the same technique adding one item at a time to the category (Demo App, Google Sheet ). Does the google sheet look accurate?

I ran into the problem you just mentioned though-- how to only show the items left to add. Were you able to achieve this in Glide? Also, do you have a method for removing items from a category?

I will make some Screenshots I think later today or tomorrow. Sorry party preparation time :grin:

1 Like

Haha-- Enjoy! Happy New Year! :partying_face:

1 Like

You can show only items left (still not chosen) filtering for …relation is empty

1 Like

So, in my case I have Sale Points. and Options.
A Sale point can have multiple Options for this I have the Sheet Sale Point Options.

This is the “basic” configuration. Two sale points with the options.

In the Sale Pont Sheet I have this columns:

Selected Options is a rollup to the Options I already have selected.
Possible Options is a rollup to the Options, so I can make the add new option button invisible when no more options are left.

In the Option Sheet I have this relations to check wich Option is used in wich sale point. The Joined related Sale Point column is important for the choice component filter.

This is the visibility rule for the button

This is the filter option in the choice component

And this is how it works.
choice

1 Like

It’s possible to do it whith a check list to mark several items at once
demo sheet

demo app


3 Likes

Nice

1 Like

Awesome! Thank you! Will try this out

NICE! Will try this out too. Thanks!

Got it to work! Thanks for your help!

Demo for adding items:

I was also able to find out a way to delete the items from the bucket, however it’s very inefficient. I have a “Remove items” button that links to the ItemsToBuckets sheet, then you select an item from the bucket and delete that item. So it adds a bunch of steps just to delete the item. Do you have a more efficient method?

Demo for removing an item:

No I found only the solution that you found. Going over the edit screen to the delete button. Perhaps the experts here have a better solution.

1 Like

After looking at your Sheet, it looks like you have dedicated columns per Category to track the Checkbox state. What if you want to support a changing category list? Eg. the user wants to add or delete categories? I guess the checkbox solution can only work if you have fixed categories?

Categories number is fixed, but you can make as many empty categories as you want. List only shows named categories. If a user wants to add a new category s/he could be taken to a tab to name an empty one. The drawback is the time consuming when creating the empty categories and the messy tab with several Inline lists

You can add a true/false column in the relation sheet to mark the deleted ones and in the add form include a list with items previously deleted demo app

ah yes-- for my use case, I want to support a dynamic amount of categories and items so I can’t have fixed columns. But yes, if I have a use case with fixed categories, the checkboxes is a sweet solution :ok_hand: