# Display and send informations from several tables in a form

**URL:** <https://community.glideapps.com/t/display-and-send-informations-from-several-tables-in-a-form/73038>\
**Category:** Ask for Help\
**Created:** [May 3, 2024, 1:40pm UTC](https://community.glideapps.com/t/display-and-send-informations-from-several-tables-in-a-form/73038 "2024-05-03T13:40:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stephanie\_Desby](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/stephanie_desby/32/74024_2.png) [@Stephanie\_Desby](https://community.glideapps.com/u/Stephanie_Desby)\
**Post date:** [May 3, 2024, 1:40pm UTC](https://community.glideapps.com/t/display-and-send-informations-from-several-tables-in-a-form/73038/1 "2024-05-03T13:40:46Z")

</div>

Hello there, I have an app where a user can browse and add places to its favorites. This User can have friends. I want to have the feature to recommend a place to a friend.  
I have 3 tables : Users (with a isFriend boolean), Places and isFavorite which contains User + places info and allows me to register all the favorite places for a given user.

From the Favorites screen, I’d like to open a form which displays the user friends and then store the infos in another table : Current user, Friends and Place so I can use this to display a notification panel for each user with their friends recommendations.

I can’t figure out a way to do this. Either the form displays User informations and I can’t get the place info or I have to use the Notification table but don’t have the info neither.

Could I have some help with this please?

---

<div class="post-metadata">

**Author:** ![raajkumars](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/raajkumars/32/74046_2.png) [@raajkumars](https://community.glideapps.com/u/raajkumars)\
**Post date:** [May 3, 2024, 8:24pm UTC](https://community.glideapps.com/t/display-and-send-informations-from-several-tables-in-a-form/73038/2 "2024-05-03T20:24:56Z")

</div>

I recommend structuring the tables as follows:

### Suggested Table Structures

1. **Users Table**

- Columns:
  - `Name`
  - `User Email`

- Relationships:
  - One-to-Many: `Friends`
  - One-to-Many: `Favorite Places`

**Example:**

| Name | User Email |
| --- | --- |
| User 1 | [user1@example.com](mailto:user1@example.com) |
| User 2 | [user2@example.com](mailto:user2@example.com) |

1. **Friends Table**

- Columns:
  - `Friend Email`
  - `User Email`

**Example:**

| Friend Email | User Email |
| --- | --- |
| [friend1@example.com](mailto:friend1@example.com) | [user1@example.com](mailto:user1@example.com) |
| [friend2@example.com](mailto:friend2@example.com) | [user2@example.com](mailto:user2@example.com) |

1. **Places Table**

- Columns:
  - `Place ID`
  - `Place Name`

**Example:**

| Place ID | Place Name |
| --- | --- |
| 1 | Central Park |
| 2 | Eiffel Tower |

1. **Favorite Places Table**

- Columns:
  - `User Email`
  - `Place ID`

**Example:**

| User Email | Place ID |
| --- | --- |
| [user1@example.com](mailto:user1@example.com) | 1 |
| [user2@example.com](mailto:user2@example.com) | 2 |

1. **Recommendations Table**

- Columns:
  - `User Email` (person recommending)
  - `Place ID`
  - `Friend Email` (person being recommended to)

**Example:**

| User Email | Place ID | Friend Email |
| --- | --- | --- |
| [user1@example.com](mailto:user1@example.com) | 1 | [friend1@example.com](mailto:friend1@example.com) |
| [user2@example.com](mailto:user2@example.com) | 2 | [friend2@example.com](mailto:friend2@example.com) |

- With this structure you can allow a user to select favorite places using the `Favorite Places` column on the `Users` Table by adding collection element for the `Favorite Places`.

- Then in the same collection element add item action to recommend a place to a friend, which when clicked should show a form to select a friend using the `Friends` Column. The form should add a row to the `Recommendations` table.

- You can either use the `Recommendations` table directly on the UI to show places recommendations, better yet create another one-to-many relationship column on the `Users` table to `Recommendations` table and then use it.

BTW: I used numbers for the ID columns for simplicity, but I would recommend using Glide’s Row ID instead. Also, you either need to filter the related tables to show only the records related to current user or better yet use Glide’s `Row Owner` feature to make them private to each user. That way you don’t to worry about accidentally showing another person’s data on the UI.

---

<div class="post-metadata">

**Author:** ![Stephanie\_Desby](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/stephanie_desby/32/74024_2.png) [@Stephanie\_Desby](https://community.glideapps.com/u/Stephanie_Desby)\
**Post date:** [May 10, 2024, 1:52pm UTC](https://community.glideapps.com/t/display-and-send-informations-from-several-tables-in-a-form/73038/3 "2024-05-10T13:52:30Z")

</div>

Thank you @ [raajkumars](https://community.glideapps.com/u/raajkumars) for your time and help.

Sadly, this doesn’t answer to my problem because when I show a new screen (from n action on a Favorite place) with the Friends table to select a friend to which I want to send a recommendations, I then can only operate with the data from Friends and I’m no longer able to fetch the data from the favorite place I clicked on.

And if I add a relation to Friends in Favorite Places, as a user can have many friends, I can’t show the list in a collection in my layout…

This is the main problem I encounter.

As you can see I did a relation with the user friends in the data, but I’m unable to use this in the layout part.

 ![Capture d’écran 2024-05-10 à 16.21.12](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/d/7db799d96bd92ea9062a915f5d3e795b1fc175fd.png)

 ![Capture d’écran 2024-05-10 à 16.21.23](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/4/b4d42a346ca91b62dfc9b8f42005a91c1896089d.png)

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [May 10, 2024, 2:30pm UTC](https://community.glideapps.com/t/display-and-send-informations-from-several-tables-in-a-form/73038/4 "2024-05-10T14:30:10Z")

</div>

You need to set the Source of the collection as the relation. You are trying to set the Title to the relation which doesn’t make sense because a relation is a link to entire rows of data. Not a specific column or value in those related rows.

---

<div class="post-metadata">

**Author:** ![Stephanie\_Desby](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/stephanie_desby/32/74024_2.png) [@Stephanie\_Desby](https://community.glideapps.com/u/Stephanie_Desby)\
**Post date:** [May 10, 2024, 2:42pm UTC](https://community.glideapps.com/t/display-and-send-informations-from-several-tables-in-a-form/73038/5 "2024-05-10T14:42:38Z")

</div>

But if I set the source to the Friends table, then I loose the ability to add the Place ID in my new Recommendation row ☹
