1 2 Previous Next 22 Replies Latest reply on Apr 4, 2013 12:42 PM by LilianBiber

    Many to many relation



      Many to many relation


           I have a many to many relation, that I cannot get to work. What am I doing wrong?




        • 1. Re: Many to many relation

               Actually you don't have a Many to Many, which would mean all StudentID would match all ClassID.

               Why do you want a Many to Many?

               But to answer your Question...

               Double click on the Equal sign connection box "=" and select and X instead of =.


          • 2. Re: Many to many relation

                 Hi Jim, thank you for responding. I think I have a many to many because a student takes several classes and a class is filled with several students. 

                 Your solution solved the problem, but you are right this is not the result I wanted. Can you tell me how I express the relation? I want to show in the classeslayout who was in a certain class. And I want to show on the studentlayout which classes someone followed. Both by means of a portal. Thank you in advance.

            • 3. Re: Many to many relation

                   When I make it a one to many relation the information on my portal does not show. I have two portals. One underneath the student information show which classes she attended and one underneath the class-information showing who was in the class. Both portals remain empty though.


                   This is was example I made, my original problem is that filemaker claims that one of my tables called 'uitvoering'  has no related tables. I do not understand why.



              • 4. Re: Many to many relation

                     What Lillian has in her first post is a correctly set up many to many relationship with a join table facilitating the many to many relationship.

                     I'd describe a relationship based on the X operator as an "any to any" relationship as it sets up a relationship where any record in table 1 matchest to all records in table 2 and vice versa. wink

                     I suggest that you reset to your original design and explain what you mean by "I couldn't get that to work".

                • 5. Re: Many to many relation

                       The portal remains empty in my example. Although I worry more about my original. Why does the system claim that the table is missing?

                       The picture is from my example.

                  • 6. Re: Many to many relation

                         @Phil  Yes but... most don't understand the you "look" from the Table Students and miss my point of "not what she needed" the X was to prove the point.  You minds see the Whole picture quickly.

                         @Lilian Phil is the master and will take it from here.


                    • 7. Re: Many to many relation

                           Then "Actually you don't have Many to Many" would not be an accurate statement, no? Which is why I posted what I did.


                           Your screen shot appears to show a layout based on Student. To what table does the portal refer?

                           "Missing Table" will appear on your layout when you have a field or portal that refers to a Table Occurrence "box" that no longer exists in Manage | Database | Relationships.

                           If you place a portal to the Join table (I can't quite make out the name StudentsInClass?), you can use that portal to link the current student record to multiple Class records by selecting from the ClassID_fk field--formatted with a drop down list of Class ID's. You can add additional fields from Class to the portal row to provide additional details about the selected class.

                           And "Allow Creation of Records via this Relationship" should be enabled for the Join table in the student to join table relationship.

                      • 8. Re: Many to many relation

                             Thanks for the intervention, you were right. 

                             I had the portal refer to class. I try to understand what you mean, but I cannot get it to work. I drew the portal and chose as table the studentinclass (you read it correctly), from which I chose the field ClassID-FK field. After that I make the field a drop down. I do not understand how to get to the class-ID's since the list of values is empty and I have to put the values in there. I am also not sure how to add additional fields. I mean I can add fields but since I don't understand the first part I get lost here. Could you explain a little further? Thanks.

                        • 9. Re: Many to many relation

                               Go to manage | value Lists

                               Create a new value list.

                               Select the "use values from a field" option.

                               Select your Class::ClassID field for the first (primary) field.

                               Then select a name or description field from Class as the second field.

                               Click OK until your dialogs are dismissed, then use this value list for your drop down list or pop up menu on your ClassID_Fk field.

                               To add fields to an existing portal, you can drag and drop from the field tool in the status toolbar to the portal row just like you would add more fields to your layout. Be sure to select the correct table occurrence name from the drop down in Specify Fields before selecting the name of the field that you want to add.

                          • 10. Re: Many to many relation

                                 Your instruction is clear, I did that, however the portal remains empty. Shouldn't the table 'students in class' have values. When I add a record, the table does not show values from the other tables. 

                            • 11. Re: Many to many relation

                                   Can you upload a screen shot of your portal while your layout is in Layout mode (Not Browse mode)?

                              • 12. Re: Many to many relation
                                /files/dd42ca9a94/Schermafbeelding_2013-04-03_om_20.18.26.png 1280x800
                                • 13. Re: Many to many relation

                                       You have this switched around.

                                       The layout you show is based on the Join table: StudentsInClass. It should be based on Students.

                                       Your portal is based on the Students table. It should be based on the Join table.

                                       I don't see why you want to show student names in this portal. Do you want to list students or classes in it? I have assumed that you want to list classes. If you want to list students, base your layout on the Class table.

                                       You may find this demo file on many to many relationships helpful. It matches Contacts to Events so you can mentally think of Students=Contacts and Classes=Events when you examine how the demo file is put together: https://www.dropbox.com/s/oyir7cs0yxmbn6i/ManyToManywDemoWExtras.fp7

                                  • 14. Re: Many to many relation

                                         The reason why I showed it is because I want to know who attended a class. This should be the correct screendump. The movie does not start on my computer, nor can I found something in the applestore to play it with. This is defenitely not my day.

                                    1 2 Previous Next