Need help with a somewhat simple issue

Hey so I’m looking for a way to make elements visible based on a field in the user’s database

example

I have set up the user’s data type to have a field of “Role”. In this field, it would contain certain words like “Admin”, “Moderator”, etc

Now say I created a dashboard page with buttons to go to different areas of the app. I’m looking to make the buttons visible based on the user’s Role.

I have tried everything i can think of nothing seems to work please help!!

Welcome to Bubble :slight_smile:

In the elements Editor (the grey box that appears when you click something on your page) …

The second tab “Conditional” is what you want …

image

Yes, just to add to Nigel’s point.
The condition to use would be: "When current user’s role is admin " … this element is visible. Make sure under appearance to make it non visible on page load so the element is only shown if the user is the admin.

You can also right click a condition and copy it. Then go to the next button and paste it. So you only have to change “admin” to moderator" instead of typing everything in.

1 Like

Thanks so much guys!!!

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