Nested database company DB ad contact persons DB

I have a database that individually stores companies. I use this DB in a RG that displays the cmpanies. I want to set another database that stores contact persons per company, so when I click the comany in the RG, their contact persons will show.

What is the best way to structure the database for this kind of relationship (link the contact persons in a separate DB to their corresponding company in another DB)?

Hi there, @janernestgo… you could go one of two ways here, and you could actually do both. You could add a company field on your Contact data type, and any time a contact is created, save their associated company to that field. You could also add a contacts list field to the Company data type, and any time a contact is created, add the newly-created contact to the associated company’s contacts field.

I’m guessing a company isn’t going to have tens or hundreds of contacts, so the list field on the Company data type could work just fine. That being said, there is no harm at all in also adding the company field to the Contact data type, and doing both gives you the flexibility to access a company’s contacts in more than one way.

Hope this helps.

Best…
Mike

1 Like

Thanks @mikeloc as always! I will try and explore these options.

1 Like