Forum Academy Marketplace Showcase Pricing Features

Multi selection in a table based on Custom States

Hello,
I would like my user be able to select some items from a table, based on items’ Custom States, without going thought the database (could be more than 100 hundreds elements…)

Here a simple use for selecting the contacts I want to send an invite : https://bubble.io/page?type=page&name=16_01_27_table_selection&id=forum_app&tab=tabs-1

Does anyone know a way to do it properly ?

2 Likes

I do now :slightly_smiling:

With the new :plus list function you can build the list as you click. Have updated the forum app to show.

The only problem…how to remove !

1 Like

Very nice tip @NigelG. Never thought about this one !

As I’ve got potentially many items, I want all the items be pre-selected and user could remove them one by one. So you’re right about “remove” which is an issue.
Selection without cancellation would frustrate my users. I image clicking an the wrong item after 30 previous ones selected. :rage: :sob:

You could potentially do something hacky with a “removed” items list. And then somehow combine the two. Maybe.

I think the best bet would be to ask @emmanuel for a :minus function.

I’ll look at this, but in the meantime, while not using :filter and say ‘all items whose id isn’t the id of the item you want to remove’?

There is no :filter on this, as it isn’t a search ?

Oh it’s a simple list of texts. Right, we don’t have filter there indeed. I’ll have a look.

Would it be there if it were a list of users ?

Yes, because then we have fields to filter on.

That would work then. Was being lazy and just pulling the emails out as texts.

I did :
for removing an item => RG’s CustomState_[User]list SET LIST RG’s CustomState[User]list:filtered <>This User’id
for adding an item => RG’s CustomState
[User]list SET LIST RG’s CustomState[User]_list:plus item This User

I played with the demo. Process is slow with the progress appearing sometimes and it also bugged sometimes.
https://forum_app.bubbleapps.io/version-test/16_01_27_table_selection

Thanks for the help @emmanuel & @NigelG, but this way is not reliable enough yet to be implemented i think.

2 Likes

Remove seems to be the one that lags.

for me, problem was more on the :plus item :slightly_smiling:

Well, glad it is consistent then :slightly_smiling:

I’d absolutely like a “:minus” option here.

My example is:
I’ve got a list of Things, with a checkbox to select one or more of them.

When that checkbox is checked, I’m setting that Thing to a custom state on a second table to show things in that table, using the “:plus” function.

The result is a list of Things to perform an action on

Problem is, when unchecking that box, there’s no way to remove an item from the custom state.

You can use filter to remove the selected item (filter where it is not equal to the selected item). But a remove would be ideal.

1 Like

The scenario I can think of is if a user clicks an item, deselects it, and then decides to re-select it.
If a filter is used, wouldn’t that still cause the re-added item to be filtered out?

Well, it appears to work.

https://forum_app2.bubbleapps.io/version-test/listselect

But do it s-l-o-w-l-y … I appear to have created a bubble crasher. Or at least a way to crash the app, app builder and references pages to all give the Chrome “awww snap” at once :slight_smile:

1 Like

Yeah, I’ve just been testing this and it crashes quite easily… Maybe in my real world use it might be a bit more stable, as users probably won’t be playing whack-a-mole with fruity tick boxes :pear::peach::strawberry::golfer::lemon:

2 Likes

It is the fact it seems to crash the bubble reference page too that is a worry :frowning:

Have emailed support.

Although “whack-a-fruit” could be a new gaming sensation.