Add reference of multiple users to another record (1-*)

I have been trying out Softr to see if I can use this for an MVP. One specific situation i figured would be easy but i cannot figure this out:

I have a list of apps and I want users to be able to favorite them . Now, this means that one App can have many users being linked to it.

I found a way to update but it always overwrites because it seems to use a set reference to UserID instead of adding a new link to the record.

Is there a way this can be done in Softr that I am missing?

Hi @JMK1984, you can achieve the described use case by using our form block. It is shown in detail how to configure it in our Event Planning template when a logged-in user can tap the button “Attend Session” and add the session to his/her favourite/attending event list.

@Marine.Hovhannisyan thank you, that indeed did the trick! Too bad i cannot trigger this from a list-detail view. Guess its just learning how to work with nocode after doing lowcode/high code forever :slight_smile:

1 Like

You are always welcome @JMK1984 and welcome to the no-code community :heart:

Yep, the only way will be to add the form block to the same page where your list details block is located. This way you will be able to collect information from the list details block also using the hidden field feature in the form block.

@Marine.Hovhannisyan got it working like that now which is great! However, is there also a way that i can have a user remove a relation from themselves to an object.

I am trying to create a favorite list which ofcourse needs to also allow someone to remove a favorite. Any examples on that by any chance or do i need to move to the custom code for things like this?

Just to be clear, i only want to remove a relation, not an entire object , so 10 users like a company, one removes, that leaves 9 relations to that company.

@JMK1984 I think what you can do is you can show each user a list of their liked items using a list or table block and configure a “Delete Record” action button (you can name it “Unlike”) on that block. In this case, when the user deletes his liked item, it will be removed from his/her list only.

@Marine.Hovhannisyan thanks for the advice , i tried it but since i am showing the list of apps with a filter on them, which is based on the relation, deleting on the record causes the app to be removed.

Ideally, it would need to only update the relational attribute and remove the relation but maybe i am expecting too much to be there by default :slight_smile: I am looking into upgrading to paid to check out custom blocks but I am not sure if the things I am thinking of are possible in softr?