Automatically populate a current user field and also another field based on the current user's function

  • 0
  • 1
  • Question
  • Updated 2 years ago
  • Answered

At the moment I have 3 tables - Users, Functions and Activities. Each user is assigned a function and there is a table-to-table relationship of "Each Function has many Users". In the Activities table there is a "user" and "function" field. Once you select a user from the list the related function is automatically populated due to the table relationship. Instead of selecting a user I need the user field to auto-populate based on the currently logged in user which I have already implemented. The issue I'm having is that I need a way for the function field to also auto-populate based on the currently logged in user.

I have also implemented a table-to-table relationship between the Users and Activities tables of "Many Activities belong to one user" but am unsure as to how I can get the "function" field in the Activities table to auto-populate based on the currently logged in user, or even if what I'm trying to do is possible in Quickbase?

Any assistance would be much appreciated.

Photo of Yane

Yane

  • 0 Points

Posted 3 years ago

  • 0
  • 1
Photo of Shaund Grey

Shaund Grey

  • 80 Points 75 badge 2x thumb
I think I'm a little confused by the question. You say first that when a User is selected in the Activity Form, the related Function autopopulates. But then your question is how to get the Function field to autopopulate.

Are you saying that when the User is manually entered, the Function field autopopulates, but when you set it up so that the User field is set automatically by the currently logged in User, then the Function field fails to autopopulate?
Photo of Drew

Drew

  • 492 Points 250 badge 2x thumb
I do this kind of thing all the time.  

Create a formula-user field called 'user-current'

Set the value of that field to "user()"  (no quotes)

That field value will then always be the current user.  Set the relationship to the other tables using 'user-current' as the related key field.