Roles/Home Pages

  • 0
  • 1
  • Question
  • Updated 1 month ago
  • In Progress
Hello everyone!

I finished building my first app and I am now starting to build roles/home pages.  We have a need for 100 roles and 100 home pages.  I'm thinking there must be a simpler way to do this.  It would be a nightmare trying to maintain 100 home pages and 500 reports (each home page will have five reports).  Is there a way to only create one role and one home page where the role will display only records based on a user's location and the home page will only display the reports based on the user's location too?

Thank you in advance!
Photo of Javier Martinez

Javier Martinez

  • 218 Points 100 badge 2x thumb

Posted 1 month ago

  • 0
  • 1
What do you mean by user's location? Did you mean the user's role?
Photo of Javier Martinez

Javier Martinez

  • 218 Points 100 badge 2x thumb
No, we have 100 different locations.  Records can be created by users in these locations.
Photo of Evan Martinez

Evan Martinez, Community Manager

  • 8,774 Points 5k badge 2x thumb
Hi Javier, 

Congratulations on building your first app! For the 100 roles/home pages, do you need them because you have over a 100 locations? Would there be a logic to how a user is assigned to a record? Perhaps a field where a user is assigned to a record that would show what records were relevant to that which user? 
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,456 Points 50k badge 2x thumb
The right way to do this is to have a table of users and their location.  The Key field to that user should be the Userid field.

Then on any table where you need to control access you create a formula user field called [Current User] with a formula of

User()

That function will calculate to the current user.  Then lookup the location down to the details table.

Then set up Role Permission with a Custom Rule for these users which are restricted by userid location.  Maybe that would be a good name for the Role. "Restricted by userid location"

The Custom Rule would be where [location lookup] = location.

Then you just need 1 Role for those 100 users and 1 Dashboard and one set of those 5 reports.




Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,456 Points 50k badge 2x thumb
The solution can support 500 users.
Can you tell me what is not working?

Are you getting the lookup of the location for the current user populated down to the detail records.
Photo of Javier Martinez

Javier Martinez

  • 218 Points 100 badge 2x thumb

Let me explain how the app works.  The app will have about 500 users.  The users are in different locations throughout the country and will create records called arbitrations.  The arbitrations will be reviewed by a team and either approved or denied.  If they are approved, a section in the table will be adjusted and now another Station will be charged and they will need visibility to those records to see why the arbitration was adjusted.

I am trying not to create 100 home pages (100 locations) and 100 roles (1 role for each location and each location will have multiple users).  Each home page has the same 5 reports.

I created the new filed Current User and have User() in the formula.  This works great.  I can't get the second part that you said to work.  The second table with the users has the Employee Number as the key field.  I can create a new table like you said for user access and create just two fields: Userid (User) and Location (Text).  The Userid field is blank if I do an upload so I can't set it as a key field.  How can I get the Userid to populate or will I have to select them all manually?

I apologize, but this is new to me.  I am trying to save some work and a nightmare in maintaining so many roles/home pages/reports.

Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,456 Points 50k badge 2x thumb
To control access based on the user, yes you will need to have a new table for the users and a field for the location.  I believe that you can upload the email address into the user field.

You may want to consider if some users need access to multiple locations.  If that is the case you may want to have a multi select field and then control access using a "Contains"  formula field

IF(Contains(ToText([Locations lookup field from Users], [Location]), true)
Photo of Javier Martinez

Javier Martinez

  • 218 Points 100 badge 2x thumb
Ok, I created the Users table and was able to create the relationship.  I followed your instructions above and selected the Location from the Users table.  Now I have two fields (one labeled Current User that pulls up the current user and one that was created with the relationship called Current User - Location).  However, they are both pulling the current user...
(Edited)
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,456 Points 50k badge 2x thumb
On the relationship between users and  the detail records, there should be a field looking up the Location field.  Maybe try recreating that lookup field.
(Edited)