AUTOMATIC FIELD VALUE ASSIGNMENT BASED ON CURRENT USER. PLEASE HELP!!

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

I have a table called "Clinics" and a table called "Batch Orders". Each clinic has multiple batch orders.

In the table Clinics I have a field called Clinic Account Managers - a user list. This list is unique to each clinic. Each user will have one assigned clinic. In the table Batch Orders, I want to Auto Populate a field's value based on the current user so they do not need to manually do so. The field I want to auto populate is the Clinic Profile Name. Based on the current user, this field would auto populate to the user's assigned clinic, based on the field, "Clinic Account Manager". I do not want to user to have to manually identify which clinic they are assigned to as they will only ever be assigned to one.


I have tried a rule on the form to auto populate this field but it is looking for a manual input of which clinic the batch is assigned to. Is there a way around this??? PLEASE HELP!

Photo of Laura

Laura

  • 0 Points

Posted 4 years ago

  • 0
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 62,670 Points 50k badge 2x thumb
Do you have an established relationships where 1 Clinic has many Batch Orders?  I gather you do.  I also gather that your goal is to be able to enter Batch orders but have them automatically be associated with the correct Clinic.  it also sounds like it's these Clinic Account Managers who are doing the entry of these batch orders.

How about if you have a dashboard report titled "My Clinics".  It will be a report where the filter is that the User List in the clinic record "INCLUDES"  the "Current user".

So for each Clinic manager, they will just see one record - their own clinic.

Then include the typically ADD Batch Order button which the relationship created for you on that report.  So to add a batch order they would launch off that report and the field [related clinic] will automatically populate for them.  That report could also be set as the table home page report for the Clinics table.

Let me know if that answers your question and i will convert this comment to an Answer to close it out.
Photo of Laura

Laura

  • 0 Points
Thank you for such a fast reply. Actually, I'm looking for a auto population of a field on a form. For a new batch to be correctly created and to conform to user properties I have already set, a clinic needs to be assigned to the new batch before saving. Since the user will be adding several batch orders per day I do not want them to select their clinic every time. Is there a way to auto populate the clinic based on the user's assigned clinic. This would be based off of the clinic account managers - user list, I mentioned earlier. Does this make sense?
Photo of Laura

Laura

  • 0 Points
Also, yes I have established a relationship of One clinic has multiple batch orders
Photo of Laura

Laura

  • 0 Points
Maybe to also help clarify, here is a mock statement of what I'm trying to accomplish

IF[Clinic Profile - Clinic Account Managers]includes[Current User]then, [Current User's Assigned Clinic] is equal to that[Related Clinic Profile]

I haven't gotten much into IF statements so I know the above is incorrect use but just to give you an idea of where my head is at with this.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 62,670 Points 50k badge 2x thumb
The method which I suggested is the easiest way to implement what you want.

The alternative method is more complicated.  You would need to set up a table of all your clinic managers with the Key field being their userid.  Then make a relationship where 1 clinic has many clinic managers so that Clinic manager table has the information as to which [related clinic] they work at.

Then on the batch orders table make a formula user field called Current User with the formula current user.  Then make a relationship back to the Clinic managers table based on the Current user field and do a lookup of that related Clinic field calling it [record ID of the Current User's Clinic].

Then, finally, a form rule thats says, where the [related clinic] is blank, then change the value of the [related clinic] to the value in the field [record ID of Current User's Clinic]
Photo of Leanne

Leanne

  • 262 Points 250 badge 2x thumb
The original solution (1st one listed) worked quickly and efficiently! Thank you!!
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 62,670 Points 50k badge 2x thumb
:)
Photo of Reza

Reza

  • 0 Points
would you please do the example for this solution?or more explain this solution?
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 62,670 Points 50k badge 2x thumb
Reza, if you have a new question, pleas post your question and explain your tables and reference this post here in your quesiton.