Forum Academy Marketplace Showcase Pricing Features

Struggling to comprehend users

Hopefully, someone can help me get to grips with this. I’m sure I’m doing something wrong, but I can’t figure out what.

I have manually created 3 users in the DB. I have created columns for address and a boolean for IsStaff. Each has an address and two of them are defined as staff (IsStaff = “yes”).

Now, I am logged in as the first user (IsStaff = “no”). I want to get a list of nearby users so according to the videos etc, I need “Do a search for”. So, I’ve created a text box and selected Do a search for and selected Users. I’m not putting any criteria on it at this point. I’m then selecting :count
To my mind, this should be a very simple count of the users table (i.e. 3). However, it only returns 1. If I change it to Search for Users:last item’s Address, I would expect (given that I’m not applying a sort order) record 3 (or possibly the last one entered if the Data tab is displaying in a different order). I don’t. I get the address of my current user. If I change it to Search for Users:first item’s Address I still get the address of the current user. If I change it to Current User then I get (as expected) the current user.

I’ve tried using a repeating group to display all the addresses but that doesn’t work either.

Clearly I have something wrong, but having been through the video and examples I still can’t work out what I’m missing.

Can anyone help me?

check this out Filtering Repeating Groups | Bubble.io Tutorial - YouTube

Hi there, @tim.foster98… based on your description of the problem, the first thing that comes to mind is privacy rules. Check to see if you have a privacy rule on the User data type (probably This User is Current User) that is getting in the way. If there is such a rule in place, you can delete it to see if that was causing the issue. That being said, you would want to circle back to privacy rules later and put rules in place that protect the data while still allowing you to achieve the desired results.

Best…
Mike

Indeed it is. Thanks Mike. I haven’t looked at the privacy settings at all yet, but why would that be in place? Surely the whole point of having something that looks up user data is to be able to look up other users data. Isn’t the point of the current user context for filtering to the current user?

That particular rule is set by default, and it trips folks up all the time. It wasn’t always like that, though… check out this thread for some context.

I have to believe the reason Bubble left the default rule in place on the User data type is to protect new users from themselves when it comes to having personally identifiable information accessible across users. Sure, you can “control” that access on the front end, but data that isn’t visible in the front end can still be sent to the browser by the server if you don’t have privacy rules in place.

Anyway, there is a ton of info out there on privacy rules, and you should definitely read up on them and figure out how to use them effectively in your app.

Best…
Mike