AnsweredAssumed Answered

Working with fields in Join Tables

Question asked by darcylydia on Jan 4, 2019
Latest reply on Jan 8, 2019 by darcylydia

Okay, another question from me over here. Thanks everyone for the feedback, this is not easy! Making progress.


I am having an issue working with fields inside of join tables. I have an anchor to buoy relationship model set up with a number of tables that all have many to many relationships (picture below). I am currently working with two tables (Contacts and Organizations). I've been able to successfully make them relate and scripted two buttons so that I can "Choose existing Organization" or "Add a new Organization". I have a portal on the Contacts page showing the Organizations that are affiliated with the contact and the information is coming through.


The issue that I'm having is that when the Contacts adds an Organization, I want them to also add a "title" with this organization. From what I understand, that is what makes this a many to many because each contact will have a title with each organization they are affiliated with and each organization will have contacts with many different titles. I tried first adding a "contact title" field in the contact table, but that did not allow for several titles each related to a specific organization. The same goes for making the field in the Organization table. What I tried now is creating a field in the Join Table- "Organizations to Join" called "Organization to Join- Contact Title" and having the user fill that out when they add an organization. I wasn't able to display that field on the contacts layout because it is not related, so I scripted it to copy and paste the title into a file called "Contact Join- Contact title" in the "Contacts Join table".


It seems to be working, the title shows in the correct records in both the Organization and the Contact join tables and in the portal that I have on the Organizations layout, the name and title of the contacts show up perfectly. For some reason on the Contact layout, the title appears as the first title that I enter and repeats the same data for each new organization. The records in the Contact Join layout all show the correct different titles but they do not show up on the contact layout and I can't seem to figure it out.


Here is my Contacts layout:


Screen Shot 2019-01-04 at 11.50.01 AM.png


When the user clicks on Add a new Organization, this is the card that pops up:

Screen Shot 2019-01-04 at 11.52.12 AM.png


The card is based on this layout, with the title field pulling from the Organization Join Table:


Screen Shot 2019-01-04 at 11.53.05 AM.png


This is the script that it performs when I hit done:


Screen Shot 2019-01-04 at 11.54.53 AM.png


These are the Join Table Records, they successfully store the information:


Screen Shot 2019-01-04 at 11.55.21 AM.png


Screen Shot 2019-01-04 at 11.56.23 AM.png


This is the Organization layout with a portal on the bottom left that correctly displays the contact and contact title information:


Screen Shot 2019-01-04 at 11.57.57 AM.png


But on the Contact page in the portal pulling from the Organization table, it is repeating the same title for all organizations. Even if I add a new value in for the next organization and it shows correctly on the record in the join table, it makes the title for that organization the same as the first.



Screen Shot 2019-01-04 at 12.01.27 PM.png


Screen Shot 2019-01-04 at 12.01.57 PM.png


Thanks in advance for any help or advice!