Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

relationships between two tables and many cards

Featured Replies

I'm creating a project management database. I'm having trouble defining relationships between two of the tables. The "project" table tracks projects, and the "contact" table tracks contacts & companies. It's easy to set one individual as the primary contact for a project, but my client wants multiple contacts from different companies to be listed on each project card. How do I relate otherwise unrelated contacts by project and have them appear in a portal. Ie, anyone of the contacts who had any hand in the project should be listed on the project entry. I can't get more than one contact to appear. Any help? Much appreciated.

Hi, isaaccs, and welcome to FM Forums!

One way to do this would be to insert multiple key values into your primary key field. That is:

I assume you are using ID numbers, rather than something changeable such as company name, as your relationship key. If not, you should start doing so. So say the relationship in question is from Project::ContactID to Contact::ContactID.

If you put multiple values into Project::ContactID, separated by carriage returns, then all Contacts whose ContactIDs are listed in that field will be related to that Project. This is the quick&dirty way to do it, and possibly appropriate for your project.

However, i would like to suggest you look into join tables, which are usually the best way of creating these "many-to-many" relationships. Do a search on FM Forums for join tables and you should come up with a wealth of information. In a nutshell, a join table does nothing but link multiple records with multiple records; records in such a file would look like:


PROJECTID   CONTACTID

---------   ---------

Proj001     Cont001

Proj001     Cont002

Proj002     Cont002

Proj003     Cont003

This shows that Proj001 is associated with Cont001 and Cont002; that Proj002 is associated with only Cont002; that Proj003 is associated with only Cont003, etc.

HTH,

Jerry

Jerry:

I agree with your last paragraph--I think the correct architecture would be to have four tables: projects, companies, contacts, and project-contacts (the join table).

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.