Forum Discussion

ChrisSwirtz3's avatar
ChrisSwirtz3
Qrew Member
3 years ago

Adding new records based on user recognition

I have an app with a Companies Table and an Offices Table which have a 1 Company can have many Offices relationship. Is it possible to set it up so that when a User from one of the Companies logs into the system, they can create a new Office linked to their Company without having to find their Company first and click the Add Office button?

For instance, if Jon Smith from ABC Company logs in (ABC Company being a Company listed in the Companies Table), QuickBase doesn't recognize that Jon is affiliated with ABC company based on the email or something like that correct? I would need to somehow link Jon Smith to that ABC Company Record Right?

------------------------------
Chris Swirtz
------------------------------

6 Replies

  • You would need to set up every user in a Users table in the app - a new table, not the User icon at the top left.  Then make the Key field their userid.  The associate each employee record with the company they belong to via a relationship with Companies.

    Then on offices you make a relationship to users based on a reference field of [Current User] with a formula of User().
    The look up their Company or related company.

    The have a  form rule populate the company field if its blank.

    ------------------------------
    Mark Shnier (YQC)
    mark.shnier@gmail.com
    ------------------------------
    • ChrisSwirtz3's avatar
      ChrisSwirtz3
      Qrew Member
      Thanks Mark,

      So adding a new user to that User Table would have to be done manually by someone correct? Perhaps make it a function of whoever does the inviting of users to also add them to the Users Table?

      What about adding a User-List field to the Companies Table and selecting every User that is affiliated with that Company. Could we utilize something like that?

      ------------------------------
      Chris Swirtz
      ------------------------------
      • MarkShnier__You's avatar
        MarkShnier__You
        Icon for Qrew Legend rankQrew Legend

        See my responses in bold below. 

        So adding a new user to that User Table would have to be done manually by someone correct?  Yes



        Perhaps make it a function of whoever does the inviting of users to also add them to the Users Table?  Well yes but totally separately and manually. 


        What about adding a User-List field to the Companies Table and selecting every User that is affiliated with that Company. Could we utilize something like that?  No, that won't work.   The issue is that when adding a record the form needs to default the companies field so the user doesn't have to enter it manually. In order to default it in it needs to do a look up from the user stable to see which user is logged in and what their usual company is. 



        ------------------------------
        Mark Shnier (YQC)
        mark.shnier@gmail.com
        ------------------------------