Add a user to a collection with a button

Hi everyone!
I have a very simple issue, but I definitely don’t know how to solve it.

I have my Users collection and a Plans collection which contains 4 plans with the name of a subscription plan, the credits that the user will receive each month and a relation with the Users collection (a user can only have one plan but a plan can have multiple users).

How can I add the login user to a specific plan when he clicks on a button?

I tried one million things with click actions like update the users collection, update the plans one, but I don’t find how to do it.

Thanks in advance!

Hi @Arikern ,

If you are correct in relating 1-many between user and plans, then you should be able to update that relationship field.

Perhaps, sharing your action would be a good idea.

Thanks for your quick reply.

When I try to update the plan collection to add the login user to it, I don’t have any option to select a specific plan or even to add the login user:

And when I’m trying to update the Login User itself, I can’t select a specific plan too:

Try recreate the relationship again.

It should be update action to users collection, but you must have available data for plans, such as using list to show plans and inside the list use icon or button to update action.

I have just recreated the relationship again but I have the exact same options than before. Obviously I’m doing something wrong but I can’t figure what.

The strange part that I can add manually a plan to a user in the database. But I don’t have this option with a button action.

Have you done this ?

Oh sorry, by a list you mean a dropdown menu right?

Try this,

OK I got you, thanks a lot.
It means that I can’t update the plan of a user after he subscribes with a Stripe component? Because this component allows to do some actions after a successful payment but it doesn’t react like a list.

Depending on your workflow, you could allow the user to go the next screen after the list and ask the payment there.

Wonderful, thanks a lot for your time and your help!

1 Like

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