How do I add up all user expenses when I the owner is logged in

I made an expenses tracker where each user can only see what they spent I did this by setting a row owner. However, I also want to make the expenses update in real-time so that when a user adds a receipt and cost it can go to another centralized tab and add the overall cost of each user. To do this I did a rollup sum of the cost column. The problem is that when I do this on my user by consequence of setting row owner it will only show my expenses and not the total expenses of all users. How could I work around this any help is much appreciated.

If you use row owners, on the device side, you can only download whatever row is visible to you, hence you will never get the total sum using that row owner - rollup approach.

If the data is sensitive and row owners must be in place, and you are using Google Sheets, I assume you can create a sheet with a single row and use a sum formula in the first row of that Sheet to sum all expenses recorded. This will work when users make updates to their expenses as well.

Then, in Glide, bring that info back to the user profiles table using a single value column. You can display it wherever you like.

You can have multiple Row Owner columns. So you could create a 2nd column, make it a row owner, and fill that column with your email address.

Or if your app is private, you could make use of roles to give multiple “Admin” users access to all data by creating an Admin role, assigning it to one or more users, and create a Row Owner column with the word “Admin” in it.

1 Like