# Linking multiple records with multiple records

**URL:** <https://community.glideapps.com/t/linking-multiple-records-with-multiple-records/58861>\
**Category:** Ask for Help\
**Created:** [March 7, 2023, 5:55am UTC](https://community.glideapps.com/t/linking-multiple-records-with-multiple-records/58861 "2023-03-07T05:55:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![beginnerglider](https://avatars.discourse-cdn.com/v4/letter/b/cdc98d/32.png) [@beginnerglider](https://community.glideapps.com/u/beginnerglider)\
**Post date:** [March 7, 2023, 5:55am UTC](https://community.glideapps.com/t/linking-multiple-records-with-multiple-records/58861/1 "2023-03-07T05:55:27Z")

</div>

I have 3 tables.

User  
Sites  
Viewers

A user creates many construction sites under his profile.  
A user creates many viewers (viewers are people with emails that will receive info from User/Site)  
Sites have 1 user but many viewers  
Viewers have many Users and many sites  
Users have many sites and many viewers

Viewers can be created by different users (as the viewer will have the same email address)

I need to find a way of having a User link created Viewers to created sites, and have a list of all viewers on particular sites.

I have tried relations.

Do I need a table that only associates Viewers to sites so i can pull out separate rows?

---

<div class="post-metadata">

**Author:** ![Uzo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/uzo/32/22639_2.png) [@Uzo](https://community.glideapps.com/u/Uzo)\
**Post date:** [March 7, 2023, 6:15am UTC](https://community.glideapps.com/t/linking-multiple-records-with-multiple-records/58861/2 "2023-03-07T06:15:43Z")

</div>

I do not know what your data looks like. Are you creating unique IDs for each site and viewer so that you can add these id’ to each relation?

---

<div class="post-metadata">

**Author:** ![beginnerglider](https://avatars.discourse-cdn.com/v4/letter/b/cdc98d/32.png) [@beginnerglider](https://community.glideapps.com/u/beginnerglider)\
**Post date:** [March 7, 2023, 6:30am UTC](https://community.glideapps.com/t/linking-multiple-records-with-multiple-records/58861/3 "2023-03-07T06:30:32Z")

</div>

Yes, each site will have a RowID and each Viewer will have a RowID, I will have to figure out a way to associate a viewer with multiple users at some stage

---

<div class="post-metadata">

**Author:** ![Uzo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/uzo/32/22639_2.png) [@Uzo](https://community.glideapps.com/u/Uzo)\
**Post date:** [March 7, 2023, 6:46am UTC](https://community.glideapps.com/t/linking-multiple-records-with-multiple-records/58861/4 "2023-03-07T06:46:18Z")

</div>

Not row ID… relation ID… you need to copy row ID to relation ID

---

<div class="post-metadata">

**Author:** ![beginnerglider](https://avatars.discourse-cdn.com/v4/letter/b/cdc98d/32.png) [@beginnerglider](https://community.glideapps.com/u/beginnerglider)\
**Post date:** [March 7, 2023, 7:18am UTC](https://community.glideapps.com/t/linking-multiple-records-with-multiple-records/58861/5 "2023-03-07T07:18:45Z")

</div>

@Uzo thanks for the help.

Here are my tables:

Users: Can create many sites and many viewers

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/7/6757b95a3e262160cf71d4d216bedd05cc7bf980.jpeg)

Sites: many Users Create many Sites

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/5/d/5d16877e2e62cbbffe650f4dc9581e620be77d7c.jpeg)

Viewers: Many users create many viewers and associate viewers to their many Sites. Other users can create the same viewer (based on the email record) for different sites they are working on.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/0/70e9644c3bdaf18d49bdf16d4f52e319147687d4.jpeg)

I need to be able to display on the interface the following on each User profile:

Created Sites  
Created Viewers

When I go into a site (from the Profile page), I need to be able to see the Viewers associated with that site

When I go into a viewer (from the profile page), I need to able to see the Sites associated with that viewer. I also need to use a “choose” function to choose a site to associate with that viewer (and by the same token, to disassociate a site from a viewer).

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [March 7, 2023, 11:58pm UTC](https://community.glideapps.com/t/linking-multiple-records-with-multiple-records/58861/6 "2023-03-07T23:58:02Z")

</div>

Before I start, there seems to be a red flag on your Sites and Viewers tables. The emails column should be normal columns, not user-specific columns.

> [@beginnerglider](#):
>
> Created Sites

Should be able to have a relation from the Users table to the Sites table with the email column (assuming “Users Email” is the creator) and display that with a collection/inline list.

> [@beginnerglider](#):
>
> Created Viewers

Should be able to have a relation from the Users table to the Viewers table with the email column (assuming “Email” is the creator) and display that with a collection/inline list.

> [@beginnerglider](#):
>
> When I go into a site (from the Profile page), I need to be able to see the Viewers associated with that site

Create a relation from the Sites table to the Viewers table using the rowID of the Sites connecting to the “Site Row ID” column in the Viewers table.

> [@beginnerglider](#):
>
> When I go into a viewer (from the profile page), I need to able to see the Sites associated with that viewer.

Create a relation from the Viewers table to the Sites table using the “Site Row ID” column of Viewers to connect to the “RowID” column of Sites.

> [@beginnerglider](#):
>
> I also need to use a “choose” function to choose a site to associate with that viewer (and by the same token, to disassociate a site from a viewer).

Not sure what you mean by this, you mean when you have a new Viewers row you need to have a choice component to choose what site that viewer can view?
