I’m learning bubble and I am creating my first bubble app, stuck in a section of my app and I need help.
I am building an app that has 2 user types, type ‘company’ and type ‘candidate’. When a company-type user logs in, I first add a workflow to log in the user and direct the user to the company’s page, but now I want the data that the user sees to be their company’s data. I can’t figure out a way to send the current company’s data to that page automatically. It only works if I add the user’s company’s slug in the URL, but I want this to happen automatically. The user is not supposed to type in their company’s slug manually, but rather get directed to their company’s page automatically (with the company’s slug).
There are a couple of ways you could do this. You could:
Send the company data to the page using url parameters or path segments and having the parent element search for a company with the value of the url param as a constraint
Have the page/parent element to reference to the user’s company by either searching for the company or referencing to a specific company record in a field
Thank you @ntabs , for some reason this didn’t work. I think what I need is a way such that when a user logs in it navigates to the URL with the current user’s company’s slug. Because if a user is logged in, it navigates them to an empty company’s page where their details are available therefore there’s no company data to display. But if I add the current user’s company’s slug to the URL the company’s data shows up. I don’t know if that makes sense.
Thank you for your time @ntabs , I really appreciate it.
What I outlined above are examples on how you might structure it. It would still depend on your data structure or how you reference to the company in the url e.g. url parameters, paths, etc
Try doing this instead:
Log the user in
Go to page x and in the data to send field, use current user’s company’s slug