Forum Discussion

SolaceSonder1's avatar
SolaceSonder1
Qrew Member
3 years ago

How to add a record to my join table

I have a many to many relationship between Patients and Labs. 

I have two questions: 
1. How do I add a record to the join table (Patient-Lab) directly (and allow the user to choose which Patient and Lab to associate it with)? This seems very basic, but I cannot find the instructions to do this in the forum or in the help documents. I want the user to have the option to choose from a record picker the Patient and Lab they want to associate together. 

2. How do I add a record to the Patient table that allows them to choose which lab they want to associate with this patient record? I need several values to populate in the record picker so the person entering in the Patient table will know which lab to associate.

------------------------------
Solace Sonder
------------------------------
  • Typically, you would add a Patient Lab Join record by launching off a Patient or a Lab Record.  If you launch off a patient record than the field for related patients should fill in automatically so you would just need to choose the lab. And vice versa if you launch off a lab record then you would just need to choose a patient but you probably don't work out in that direction.
    The best practice is to have a field on the patient record called patient identification although in your case it could simply be patient full name, and similarly on the lab record to have a field for the lab identification. You may need to build a formula field to make these identification records.
    Then on each relationship you look up those identification fields and set the field for [Related Patient] to be that have a Proxy of that [patient identification] field.

    Just be sure that the patient identification field and the lab identification field are on the form for that patient lab join record.


    ------------------------------
    Mark Shnier (Your Quickbase Coach)
    mark.shnier@gmail.com
    ------------------------------
    • SolaceSonder1's avatar
      SolaceSonder1
      Qrew Member
      I completely understand, Mark. Thanks for the assist. Let's just focus on the #1 case. If we solve that, it will be good enough for a while. 

      Here is the relationship/field structure in both directions. 
      When I view a Patient record, all of this data populates properly. 

      However, when I try to add a patient lab by clicking on the "Add Patient Lab" in the Patients table, this is what I get:

      Notice that Patient Primary Key is blank, despite this being clicked from the Patient record directly. 

      Here is the URL formula for the Add Patient Lab: 
      URLRoot() & "db/" & [_DBID_PATIENT_LABS] & "?a=API_GenAddRecordForm&_fid_26=" & URLEncode ([Patients Primary Key])& "&z=" & Rurl()

      Also, notice the Lab Primary Key is a read-only field. How do I create a lookup where the user can select from all Possible Labs which one they want? Normally I would think this would be done by a record picker, but it's almost like the URL for adding a Patient Lab isn't populating properly. 
      ā€‹ā€‹

      ------------------------------
      Solace Sonder
      ------------------------------
      • MarkShnier__You's avatar
        MarkShnier__You
        Icon for Qrew Legend rankQrew Legend
        I agree that something is seriously messed up on that form behavior.  Can you show me a screen shot of the form setup for the field Patient Primary Key on the Patient Labs form?  ie customize this form and then highlight that field and take a screen shot?


        ------------------------------
        Mark Shnier (Your Quickbase Coach)
        mark.shnier@gmail.com
        ------------------------------