8 Replies Latest reply on Feb 24, 2016 7:23 AM by kasenofonte

    Creating a list from table




      I have a table of companies.  I want to create another table of owners.  In that owners table I want the list of companies from the compose table.  I need to assign who owns different companies.  Companies A,B,C are in the companies table.  I want the owners table to have a drop down of the companies so they can names owner.  Company B owns A; Company C owns B, etc.


      Any thoughts.... thanks



        • 1. Re: Creating a list from table

          Do you need a separate table for owners? It sounds as though Owned By is an attribute of a company, unless can a company have multiple owners?



          • 2. Re: Creating a list from table

            Since Companies may have many Owners and Owners may have connections to many Companies, I would create a JOIN table with the ID of each.


            Companies::CompanyID_pk (primary key)

            Owners::OwnerID_pk (primary key)

            Companies_Owners::c_o_pk (primary key)

                 Companies_Owners::CompanyID_fk (foreign key)

                 Companies_Owners::OwnerID_fk (foreign key)


            I suggest you study about relationships in the help and other FMP documentation. There are tutorials on this forum and posted topics that may help you.



            • 3. Re: Creating a list from table

              Hi Beverly,

                   You're absolutely right, the JOIN table would be necessary if the relationship truly is a Many-Many. However, if a company can have only one owner at a given time, and there is no need to track owner history then Owned by could be treated as an attribute in my opinion.


              I'm not entirely certain which case this is, which is why I asked.


              Thank you for recommending further learning.



              • 4. Re: Creating a list from table

                there are many instances where "one-to-one" has OOOOPS! suddenly become many-to-many, so the advice for any developer to think ahead. at the very least if no join, then a relationship directly between Companies and Owners as they can have very different other attributes.



                • 5. Re: Creating a list from table

                  Sounds like solid advice, thanks for clarifying!



                  • 6. Re: Creating a list from table

                    Hi, thanks for input.  Someone else created this.  There is a company table, a TO called company owned and another called owned company.  Any one company to be owned by another and be the owner of the other.  These tables a linked by the company id, then company owned id and owned company id.  We are trying to create in an ownership table that would show company A, with a portal that will show company B owns company A, but company A owns C.


                    ownership table is linked to the all three TO by the appropriate ID's.  We are trying to, while in ownership table, select from a drop down the correct company, the the dropdown will not show all the companies.  The value list is set up correctly...


                    I hope this is not too confusing.  

                    • 7. Re: Creating a list from table

                      Have you made sure that "Include all values" is checked rather than only related?

                      See below:

                      FM ScreenshotValueList.png



                      • 8. Re: Creating a list from table

                        yes, include all values is selected....  thanks