I have created user profiles and onboarding welcome screen for all my users. I’m trying to create a leaderboard but I can not see all the users points, I can only see the points of the user that is signed in. In addition on the data editor it shows the same points regardless of the user (see pic below).
What am I doing wrong?
That’s because you have enabled Row Owners on your Email column, so only the data for the signed in user is downloaded to the user device. If you need data for all users to be accessible to everyone, then you need to remove Row Owners.
If I remove row owners, then each user will enter data but can also modify data for other users too?
Are they editing their row through the edit pencil? You can set a condition on that edit pencil to only show if the email in the row is the signed in user. You can also set filters on your data based on signed in user.
Row Owners is more of a security feature to prevent data that should be secured (not owned my the signed in user) from being downloaded to the user’s device. Savvy users can snoop the data that’s downloaded, so row owners prevents un-owned data from being downloaded. If you don’t have any data that needs to be secure, and all users need access to the data of other users one way or another…then you should be using filters and conditions instead, so that all data is downloaded to a user device and the leaderboard works correctly.
each user’s data should be secure or they may not use the app. Is there a work around this? perhaps, making a new sheet that brings the users name and email and points and then making an inline list that dysplay users name and points?
If you need to have it both ways, then you should have tables with data that all users need to see without any row owners, and have other tables with secure data that should be protected by row owners.
nope it did not work either. I created a simple spreadsheet with name email and image for users and another sheet to enter points (credit value, amounts and math column to see the result (credit value * amounts). Then I bring the math column to the user sheet via a roll up column and it shows the same number of point for all the users.
I assume you would use the points sheet for your leaderboard? Are you using a relation/rollup combination or just a rollup to the entire sheet? You are gonna need an email in your points sheet and relation linking the user sheet to the points sheet. Then having the rollup reference the relation would give a unique points value for each user in the user sheet. But I’m not sure everything is going to work correctly depending on what you want your leaderboard to display. You would still have row owners in your user table so that’s still going to restrict which data is visible to the user.
It may be best if you can share some screenshots or a video so we can better understand your setup, how your app works, and what you are expecting for an end result.
Can you show what one of your activity tables looks like? Do you have a row for each user, or are all the rows shared among all users with the points entered into user specific columns? I can see a couple of things that would be an issue, but I want to make sure I understand how your activity tables are set up.
One thing I’m noticing is that you have a lookup to your activity totals table, but I didn’t see an email or any way to identify a total for each user. I just want to confirm if your activity tables actually identify who the points belong to. If your activity points don’t identify a user in any way, and your lookup is just pulling the totals value, then yes, each user is going to show the same amount of points. Although, you still have Row Owners in your user sheet. That’s why the rows for the other users are greyed out. The Row Owners are applying and the app technically wouldn’t have access to those greyed out rows.
You also mentioned that you deleted a bunch of Row ID column. I want to stress that Row ID’s and Row Owners are completely different things and in no way are they related. Row ID’s just give a unique identifier to a row that will always be unique. They also help when using User Specific columns. User Specific columns are a type of relation/lookup. I believe there are hidden tables within glide that store user specific columns for each user and the row id is a way to link that row to the correct value in that hidden table by using the row id and the signed in user’s email. We don’t see how user specific columns work, because it’s all handled internally by glide. Row Owners, on the other hand are applied to email columns. I can see that you have row owners applied in your user sheet because of the greyed out rows as well as the little blue avatar icon in the email header. Any time you have Row Owners applied to a table, then only the rows that are not greyed out and match the signed in user’s email, will be downloaded to the user’s device.
More on user specific columns…if you are using user specific columns to store the points for each activity, then there is no way for you to see the accumulated points for each user. User Specific columns store values uniquely for each user, so the signed in user will only ever see their own points. Again, I’m not sure how you have your activity tables set up, so I’m not sure if you are using user specific columns or not.
Yeah, as I kind of suspected, you are using User Specific columns in your activities tables for the user to enter their points. That will make it very hard to create a leaderboard. User Specific columns only show the values that the signed in user entered. There is no way for a user to see another user’s point values. In the same respect, the User table can only access the total points, from those user specific columns, for the user that is the signed in user.
Two things that you need. First you need a leaderboard table that has some sort of information to identify a user without exposing anything that you feel would be secure information. This could be an email address if you are comfortable with that, or maybe it could be the Row ID from the user table that’s written to a user row id column (this would be used for creating a relation in the step below). I don’t know if you would include names in your leaderboard or not, but maybe that’s something to consider adding as well, because since you have Row Owners enabled on your user table, you will not be able to create a relation to the user table, and any one user will only ever be able to access their own information from the user table. Maybe you first need to establish what information the leaderboard will contain and what should be seen by all users. This table cannot be under Row Ownership because the intention is for all users to see all of the data. This table also cannot contain any User Specific columns for the same reason. All users need to see all of the data. First decide what your leaderboard should look like.
Next, you need to figure out a way to copy those total point values for each user to the table above. The points need to be written to basic non-user specific columns. There are several ways to accomplish this, but it all depends on how and when it should happen. The simplest with your existing setup would maybe be to have a kind of submit button with a custom action that will either add or update the row above. This requires the user to press the button…unless you can find a way to execute the action elsewhere while they are updating their point values. To do this, you would need to create a single relation from the user table to the leaderboard table using the email or the row id. We are simply just checking if there is already a row for that user in the leaderboard table. Then, the custom action for the submit button could have an IF statement that checks if the relation is empty. If it is, then add a new row to the leaderboard table including the total points and any additional info from the user table. If the relation is not empty, then you would simply update the point value through the relation.
I know this is a broad overview and kind of vague, but the biggest hurdle is that you are trying to take several pieces of information that you are storing privately for each user (via Row Owners and User Specific columns) and trying to make some of it publicly available to all users in the form of a leaderboard. Your options are to either structure your data so it’s not under row ownership or user specific…or you duplicate those results elsewhere in a table that contains only the public information. I don’t want to get too in depth into a specific method if it’s not going to work out the best for you. It may make things more confusing. I think it’s better that you first understand why you are running into these problems. Once you understand, then it becomes much easier to understand how to change your structure a little bit to get the results you want.
Glide does not make a lot of assumptions with your data. It’s not going to assume that you want to accumulate and publicly display data that was intentionally set up to be stored and secured privately. Instead, you need to structure you tables, data and app flow in a way that can distinguish what needs to be stored privately and what needs to be stored publicly.
Would you be willing to make your mini app copyable and share the published url link with me? Then I could make a copy and throw something together either tonight or in the next day or two. I don’t think it would take me long. I think you could still keep your row owners in the user sheet and I would probably recommend keeping user specific columns in the education sheet. The only part that’s harder to explain is adding and updating records in the leaderboard sheet.
A couple of additional questions, what information do you want to see on the Leaderboard? Name and points? Anything else? Is it safe to assume that a user could enter 4 for the activity number, but later come back and update it to 5?
Yes, Here is the link:
On the leaderboard: name, total number of points and place (1st, 2nd 3rd … and so on). The user should be able to enter and update the different activities several times during the year.
OK, I whipped this up quickly. Take a look and see if you have any issues or questions. I reverted the Amounts column back to a user specific column and re-enabled row owners, so any user data is protected except for what is added to the leaderboard table. There is use of Custom actions when viewing the activity details, and on the buttons to submit or cancel the point entry. Pay specific attention to how I set up those actions.
Instead of using the native form, I’m using a custom form based on the activity details screen. (It’s just entry components and buttons with actions). When a user enters points, it’s saved to a temporary column. If they cancel out of the form, only the temporary value is cleared. If they submit, then the temporary Amounts value is written to the Submitted Amounts value. Also, the submit will check if the user’s rowid is already in the leaderboard table. If it is not, then it will add a new row with the total accumulated points from all activities, along with their name and image. If they already have a row in the leaderboard, then it will simply update that existing record through the relation.
Copy it, play with it, and make it better.
Okay this looks great! I will enter this into my app and will let you know how it goes.
The leaderboard works well. But, I got a new issue:
All the main categories are in one table but I need to show the sum of all the points in each of the main categories. As you know, all the points are going in the same math column. So how can I display the different amounts if they all go in the same math column.
Sorry for the delay. I made a few alterations to the app I shared above. Mainly I added a main activity column to the leaderboard table that will also be filled when new rows are added to the leaderboard table. Then I create a template column in the Education table and the Leaderboard table that joins the user id and the activity name together. The rel-Leaderboard table then uses the template columns to build the relation instead of just the user id. Now the leaderboard will contain unique rows for each user/activity combinations instead of just unique rows for each user. This will make it easier to rollup a sum of points for each user, or each activity, or each user/activity. I’m not sure how you would want to display those results, so I didn’t do anything beyond that, but this should be enough to keep separate leaderboard stats for each user/activity…and with enough information to still be able to get totals for just the activity or for just the user.