Pass business data to page

Hello, I have a data type called business.

When a user signups, they go through a onboarding process where they setup their business. The whole web app is anchored around the business they setup.

So after the onboarding flow where a new things has been created [Business] . How can I pass the business data to the dashboard and make sure when the user login, they login to the business dashboard they’re assigned to?

Any instructions would help or a good tutorial.

Thank you!

Your business should be saved in a field on the User data type so you’d just load Current User’s Business.

Of course, but how do you do that?

That’s what i’m asking.

Current User's Business

Are you saying inside the user datatype, I should create a reference to the business?

I thought it was the other way around.

I thought bubble was similar to a SQL database.

Yes.

I thought it was the other way around.

You can do it the other way round only if a Business can only ever have a single User.

If that’s the case, then you can do it the other way round if you prefer (although in Bubble it will be slightly more costly in WU that way)

I thought bubble was similar to a SQL database.

Indeed. Bubble uses PostgreSQL under the hood, so (in this instance at least) it’s no different from how it would be done in a regular SQL database.

In a standard SQL database you should also have a Business field on the User table, not a User field on the Business table (unless each business can only ever have a single User, in which case it can be done either way).

1 Like

Makes sense, thank you brother :+1:

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.