11 Replies Latest reply on Dec 16, 2016 2:58 AM by FileMakerMentor

    Popup From Value List

    kkirkhoff

      I have 2 tables, Patients and Doctors.

      - Patients has a Name and a doctor_id (foreign key).

      - Doctors has a name and a doctor_id (primary key).

      I link the foreign key (Patients table) to the primary key (Doctors table).

      I have 3 Doctors in my Doctors table.

      I have 1 Patient in my Patients table.

      I put a popup menu on the Patients layout that will contain Doctors.

      I create a Doctors value list with the Name and doctor_id from the Doctors table.

       

      I go to Browse mode... the popup (on the Patients layout) is empty.

       

      Thoughts? This seems so basic that it's hard to find a very simple tutorial/example that does this.

        • 1. Re: Popup From Value List
          David Moyer

          Hi

          is your value list based on All Values or Related Values?  It should be All Values in the Doctors table.

          • 2. Re: Popup From Value List
            erolst

            kkirkhoff wrote:

            I put a popup menu on the Patients layout that will contain Doctors.

            I create a Doctors value list with the Name and doctor_id from the Doctors table.

             

            I go to Browse mode... the popup (on the Patients layout) is empty.

            Did you actually assign your new value list to the popup field? It's a common mistake to forget this step ...

             

            This isn't related to the issue, but din the value list definition, did you use

             

            1st field: Doctor::doctor_id, 2nd field: Doctor::name

             

            in that order?

             

            kkirkhoff wrote:

            I have 2 tables, Patients and Doctors.

            - Patients has a Name and a doctor_id (foreign key).

            - Doctors has a name and a doctor_id (primary key)

            Your patients have a primary key, too - yes? (Just checking ...)

            1 of 1 people found this helpful
            • 3. Re: Popup From Value List
              philmodjunk

              Also keep in mind that you will need a more sophisticated set of relationships than what you describe if it's possible that a Patient may need to be linked to more than one doctor.

              • 4. Re: Popup From Value List
                kkirkhoff

                Thanks for the quick response, guys!

                Yes to all your questions.

                 

                Here's something I just noticed that may help. When I manually enter a valid _kf_doctor_id into the field on the Patient layout, it fills the popup. But when I then select an item from that popup, it doesn't change the _kf_doctor_id field. (ugh!)

                 

                Here's all my info...

                Screen Shot 2016-12-15 at 7.44.58 AM.png

                • 5. Re: Popup From Value List
                  David Moyer

                  I think you need to apply your value list to the serial number field.  When you open the pop-up on the pk_doctor_id field, it should show the doctor name, but populate the serial number with the id.

                  1 of 1 people found this helpful
                  • 6. Re: Popup From Value List
                    philmodjunk

                    Your value list setup is wrong. Field 1 should be the ID field and field 2 should be the name.

                    • 7. Re: Popup From Value List
                      erolst

                      David Moyer wrote:

                      I think you need to apply your value list to the serial number field.

                      Definitely!

                      1 of 1 people found this helpful
                      • 8. Re: Popup From Value List
                        FileMakerMentor

                        The two elements of the value list by field option is confusing.

                         

                        The top dropdown on the left is for either a local table or a related table.

                         

                        The right hand drop down should be either the same relationship/table as the one on the left, or an outer join of that.

                         

                        The lower dropdown should point to the base table (the left hand table object), or if in a portal, the relationship used by that portal.

                         

                        Consider the bottom drop down as you left leg (related from), and the top drop downs as your right leg (related to)

                         

                        Hope this helps,

                         

                        David

                        • 9. Re: Popup From Value List
                          erolst

                          DavidLawrence-BusinessLogical wrote:

                          or if in a portal, the relationship used by that portal.

                          What relevance does any portal have when setting up a VL, using related values or not?

                          • 10. Re: Popup From Value List
                            kkirkhoff

                            Ok, it's fixed. I'm not sure if one of the answers was it, but here's what I did. (I'm still new to FileMaker, so terminology may elude/confuse me).


                            Double-clicking on the menu brought up a Specify Field dialog. That was linked to the _kp_doctor_id key in the Doctors table. When I changed it to the _kf_doctor_id key in the Patients table, it worked.

                             

                            Thanks everyone for your inputs! Christmas just came early for me!

                            • 11. Re: Popup From Value List
                              FileMakerMentor

                              Hi what I meant was if the pop-up value list field was in a portal row.

                               

                              Hope this helps,

                               

                              David

                              1 of 1 people found this helpful