Forum Discussion

MarcNelson's avatar
MarcNelson
Qrew Cadet
8 years ago

Can a relationship field be populated based off of the current user rather than using a dropdown to select?

I have a relationship where one employee has many overtimes. When an employee is signing up for overtime, I have a drop down that lists the users from the employee table. Each employee has a quickbase user field that is linked to them. I want the drop down list to auto select the current user filling in the rest of the relationship fields.
  • The ideal way to do this is to change the key field of the Employees table to be the Userid field. Then, when records are being created in the overtime request table, there will be an option to default it to �current user�
    • MarcNelson's avatar
      MarcNelson
      Qrew Cadet
      Would I do that in the main table "Employee"? I have a separate table where they are creating records that has a relationship of "Employee has many records"

      Also, I seem to get errors when trying to convert the field to Key. If needed, Ill get the text of the error.

      Thanks for the help!

      Marc
    • QuickBaseCoachD's avatar
      QuickBaseCoachD
      Qrew Captain
      I suggest that you make a copy of the app to practice on. 

      Let me know what the error is.  Likely, not all of your employees have a Quick Base userid.  To use that method each Employee needs to have a userid
    • MarcNelson's avatar
      MarcNelson
      Qrew Cadet
      I copied the application and then removed all of my employees that do not currently have quickbase username. That seemed to do the trick with the Key field and then that also allowed me to set the default as current user. Eventually all employees will have a quickbase username so that should work. Thanks!