“Run as” feature not working properly

I’ve been encountering some issues following the Build Your First App YouTube tutorial.

If I run as any of the users, Bubble won’t show what it’s supposed to show to an user unless I log out and back in. Here’s an example of me running the Dashboard page as the user John Doe via “Run as”:

Now, after logging out and in:

I can’t do the same for the user Jane Doe, since I created it through the “+ Add User” button on the dashboard.

I’ve checked the privacy rules, and I see nothing wrong:

And the project does contain Jane Doe as a member:

Hi there! What’s your data source and/or page load workflow to show that data? Is it possible theres a workflow tied to a user sign-in step that isn’t applied when using Run As?

Hi! Thanks for your reply!

By clicking the login button, the data that is sent is the Current User’s Team. Should I change it to Current User?

I tried doing that, but it gave me 7 issues, because everything in the Dashboard is tied to the Team, not the User. Maybe that’s my mistake, but I don’t know if there’s an easier way to do this.

Ah yes that’s what I figured but wanted to make sure - since you have a workflow tied to the Login button, that is a workflow that of course wouldn’t be engaging when using the ‘Run As’ button instead (since the Login button wouldn’t be clicked by you). Instead of sending the Current User’s team when clicking the login button, couldn’t you just set the page data to display Current User’s team?

It is set to display the Current User’s Team. However, after pressing the button, I must go to the Dashboard page. For that to happen, I need to fill the “Data to send” field, and it only accepts “Team”, because Dashboard content type is Team. Should I change the content type to “User” and make the necessary changes?

I would change anything you need to avoid tying a ‘send data’ to your login button, as this may become dicier down the road as well (like if you add OATH login, for example, plus the Run As issue you’re dealing with now).

You can have groups on the page with a data type different than the page - so your page could still be ‘User’ and your dashboard a group of type ‘Team’, and shows ‘Current page’s user’s team’ or whatever the source might read as with your database structure.

How would I load the Dashboard page then? It won’t allow me not to send data when I add the action “Go to dashboard.”

What I did was change the type of content of the Page dashboard to User and keep the type of content of the main parent as Team (data source “Current page’s User’s Team”), but the problem persists.

Apparently, when I run via “Run as” the team is set to Lorem Ipsum. Would you know what could be a cause for that?

Yes, this is because there is no workflow tied to the ‘Run As’ function.

Can you share screenshots of your login & Go To Page workflows, as well as the Page data structure (User) and the Group ‘Team’?

I got a workaround.

The solutions I found online involved using slugs, which is not a concept I’ve been introduced yet. So I did it in a roundabout way.

I kept sending data upon clicking the login button. I still don’t understand how I would be able to not to that.

Then I added a “When Page is loaded” event on the Dashboard, so that it would do the same as when I click the button on the login page.

1 Like

These are the screenshots:

When the login button is clicked

The user data structure (I’m assuming that’s what you mean by “Page data structure”)

The group whose type of content is Team

Also, the solution I came up with. An event I created to send the user data to the page when it is loaded, regardless if it is via log in or “Run as”:

1 Like

Thanks for the detailed breakdown, and I’m glad you got it to work! I think what is throwing me off is that your login button doesn’t seem to be on the Dashboard page, and that you’re redirecting the user from whatever page we’re currently on to the Dashboard when they login. I haven’t seen that done and couldn’t say whether it’s a good use-case - but it does seem to work for your setup!

The login button is only on the login page. That’s why it redirects to the Dashboard.

Through the Dashboard, I can only logout.

I’m just experimenting and looking for any potential mistakes I made while following the tutorial. It is a really simple app. Later on, I want to add other features, as to make it a more complete app, closer to what a real one would be like.

Thanks for helping me out!

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