Updating a 1-m property in collection

I need on a data base action and need some urgent help.

I have a Bubble collection and a User collection. 1 user can be part on only 1 bubble, but a bubble can have many users.
I am not able to find out how to remove a user from a bubble. i.e. when user wants to leave a bubble.

on the form I select a update action

When I select user field, I do not get an option to remove logged in user from bubble.

As it is a simple 1-m relationship I was expecting I will get some option to remove a member from list of user. Something like this

Kindly suggest what can be a possible solution.
Best Regards

Try to update Logged in User instead of Loggend IN User > Bubble.
Here you should find Remove > Current Bubble. I am assuming you have the Bubble record you want to remove somehow available, for example from a list showing the assigned bubbles of the user.

I tried that… but I am not getting that option here. Not sure why. I do have another n-n mapping between user and bubble, i guess thats what breaking it (but not sure.

I am not sure, but I think the problem is the 1-m relation. Add and remove for me only works with Many to Many.

yeah… thats what I meant. it is not working for 1-m . Data model requires me to keep a 1-m model. But it seems for now I have to change it to m-m, to get it working.

For 1-m you actually would need to update it to Empty (NULL). Never tried this. Maybe it works with a dummy (hidden) empty input field? But wait,… that would remove ALL bubbles, if you start from the user record. I am running out of ideas.

Yeah its tricky. BTW how to add NULL ? I do not get an option to change it to NULL/EMPTY.

There is not NULL option in the selection. My idea was to “fake” it with an empty input field. That would be available via Form Inputs. But it would probably not work to enter a string as a value that expects a relation. You could create a Dummy user, make it available via filtered dropdown. But you would have to filter out the dummy user in all lists - not really a good solution.
Easier would be to change to many to many and control the restriction 1 user can be part of only 1 bubble by visibility rules. (Logged In User > Bubble> Count = 0)

Yeah… that looks like only clean solution, will cause a lot of rewiring.
As we are on this, do you know if there is a way we can get a bug logged on Adalo team for this.

Hi @tuachotu @karimoo

I’d be interested to know about the solution for this as well!

Meanwhile, I’ve found some workaround, not perfect, but might be useful.

The key here is to create an additional field (call it NullBubble for instance) in Bubble collection, and make this field a relation to Bubble collection. As a result you will be able to relate to this field when updating the Logged In User’ s record (bubble relation).

I’ve created a short 2:45 video with explanations. When creating, I thought that “pseudo-Bubble” record should be needed to properly reassign user to bubble (and then filter the list, excluding this pseudo bubble".
But it seems this is not needed - it worked for me just leaving this “NullBubble” field empty :slight_smile:

1 Like

Thanks for posting the workaround.
I ended making it m-m relation. That allowed me to work with in that property. It does makes few of the screens little slow, but it is working fine.

1 Like

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