Forum Discussion

Re: How to setup a client protal

I did see the form wizard where I could embed something on a website, but I really like the idea of a client only app. I could create a client role inside that Quickbase app to control what they can see and create a you can only view what you input restriction. 

I am interested in your approach to tie a user to a company in your app. For example we have Parent Companies, Sub Companies of the Parent Company, with locations and workers. So how would I lock it down so that in a drop down menu client a only sees stuff related to their company. Would I create a client table and relate the parent companies to that client and force that field to autofill to the current user?



------------------------------
Jordan Beatty
------------------------------

1 Reply

  • MatthewLysinger's avatar
    MatthewLysinger
    Qrew Trainee
    You can create forms that you embed on the internet but the problem is without a user login (either for Quickbase or your website) there is no way to identify who the user is or what company they work for and filter the data they see.

    What I did was create a peoples table and a organizations table and created a relationship between them. You may need a third table which will have multiple relationships with the organizations table - the reference fields in this third table would be named Parent Company and Subsidiary.

    The peoples table should have a user field named "User Account". You should also have a formula checkbox field called "Is Current User" with the following code:

    If(User()=[User Account],true,false)

    In your organization table you need a summary combined text field that combines people from the people's table that have user accounts (user account is not blank) - this can be named Users.

    Then you need a formula checkbox field on the organizations table named "Current User Is In Organization" that says:

    Contains([Users], ToText(UserToEmail(User())))

    Now when someone logs in and if they are related to that organization those checkboxes will be checked. Now that this is setup you can filter what the user see by saying only show data related to the organization the user is in.

    Also you may want to set the user field as the key field in the people's table that way on your form you can create a relationship with the people's table and set the user fields (reference) default value as current user. Since your user field is the key field you can then create lookup fields which will bring in additional information about that user. (I use a separate merged table for users instead of the peoples table). So basically when a user clicks "Create new form" or w.e. you may call it, the user field is automatically set to them and the data is filtered based on what organization they belong to.

    You can also use this method to further filter other types of data that the user has access too.

    I hope that has helped you. If you have any additional questions or ideas please let me know.

    ------------------------------
    Matthew Lysinger
    ------------------------------