Forum Academy Marketplace Showcase Pricing Features

Current Page User Mystery

OK, this is a mystery… and it’s driving me crazy. I’m trying to hide a group when a field (“Company”) on the User record = “yes”. But I’m experiencing some erratic behaviour:

When I view the record (set to user=Current Page User) with one user the section is hidden, but when I view the same record with a different user the section is visible? It makes no sense - everything else is the same!

To prove it to myself I put some dynamic text on the record to display the Company field :format as text. Sure enough - the value displays as “yes” when I look at it with one user, and “no” when I look at the same record with the other user??? HOW? WHY?

I believe this has something to do with the use of the Current Page User, but I cannot work it out. One peculiarity about my app is that I have created a way of one user logging in as a Company Account (where Company=‘yes’), but I cannot understand why this would cause the problem I described…

Current user and Current page user are two different thing.
Current page “something” is based on the Data type of the page. In your case, this mean that you have set the data type of the page to User. But it doesn’t mean this is the current user. The user need to be provided to this page so Bubble will be able to check to the user source that may not be the current user (it can be any user of your DB. But the informations about this user need to be provided by a WF for example).
Maybe what you are looking for is to use the Current user (that is the current user logged in your app).

Thanks Jici, but that does not seem to be the issue. Let me try to describe my situation better:

  • User 1 and User 2 are both looking at User 3’s profile.
  • My User Data Object has a yes/no field called “Company”
  • User 3’s Company field is set to “yes”, User 1 & 2’s company field is set to “no”
  • The page is set to type=User
  • When the profile page loads, the User 3’s data is sent to the page (and appears in the URL making it the Current Page User if I understand it correctly)

Here’s where it gets odd…

  • User 1 looks at the page to view User 3’s profile and sees the value of User 3’s Company field=“no”
  • User 2 looks at the same page to view the same profile but sees User 3’s Company field=“yes”

Essentially they are looking at the exact same record but seeing different data? How can this be possible?

It sounds like you’ve got the wrong datasource (you’re probably mixing up current user and current page user).

Maybe post some screenshots of what you’re currently doing for someone to take a look at.

Where exactly is the current User seeing User 3’s Company field? Is it displayed on the page, or being used in a conditional somewhere?

1 Like

Hi. Yes, it’s hard to explain… (and the possibility I have made a mistake is the most likely one) so let me try to explain… It’s (largely) a single page application

  1. The Page has Type of Content = User

  2. One of the virtual pages is a group called “Group UserProfile”

  3. The sub-group I’m trying to hide with a condition is:

Here is the only condition on that group…

  1. As I mentioned, *User 3’s Company field is set to “yes”, User 1 & 2’s company field is set to “no”

  2. When User 1 views the page he sees Group Education, but User 2 does not.

  3. To test it I displayed the Company field on Group User Profile

  4. When I view User 3’s record logged in as User 1 I see this…

  5. When I view User 3’s record logged in as User 2 I see this…

It makes no sense? I’m just looking at the same field value, but it is changing based on who looks at it??

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