Many to many relation
I have a many to many relation, that I cannot get to work. What am I doing wrong?
The portal will only show data if you create the needed linking records in the portal. From what I can see, you also need to enable "allow creation of records via this relationship" for the join table. Otherwise, your portal would show a blank row for adding new records in the portal.
PS. I'm just an unpaid "volunteer". I don't access the forum 24-7.
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 =.
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.
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.
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.
I suggest that you reset to your original design and explain what you mean by "I couldn't get that to work".
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.
@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.
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.
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.
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.
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.
Can you upload a screen shot of your portal while your layout is in Layout mode (Not Browse mode)?
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
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.
As I said in my last post. If you want to list the students linked to a specific class, start with a layout based on Class rather than a layout based on Students.
The screen shot you show would list all the class records linked to the current student--the reverse of what you have requested. The portal would still be based on the join table, but now the fields outside the portal would come from the Class Table occurrence instead of Student.
I would want them both, but this is what you mean.
Yes, that would list all related student records for the current class.
If you placed a portal to the Join table on a student layout, you'd get a list of all related Class records.
You can also set up summary reports using a layout based on the Join table. Such a report could list each class as a sub heading with the roster of assigned students listed below each Class or a report based on that layout could list each student as a sub head with the list of assigned classes listed below each student.
But my portals still show no results, although I have 2 records in class and 2 in student. Studentinclass remains empty except for the field I created in the table studentinclass
Can someone help? Shouldn't the joined table be filled with data and do you have a suggestion why this is not the case?
Hi Phil, I am happy that you are back, will check this right away.
Phil, it worked, thank you very very much.
Retrieving data ...