# Adding Collections to CRM form

**URL:** <https://community.glideapps.com/t/adding-collections-to-crm-form/63375>\
**Category:** Ask for Help\
**Created:** [July 1, 2023, 3:12am UTC](https://community.glideapps.com/t/adding-collections-to-crm-form/63375 "2023-07-01T03:12:03Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![gbigelowtutordoctor](https://avatars.discourse-cdn.com/v4/letter/g/9e8a1a/32.png) [@gbigelowtutordoctor](https://community.glideapps.com/u/gbigelowtutordoctor)\
**Post date:** [July 1, 2023, 3:12am UTC](https://community.glideapps.com/t/adding-collections-to-crm-form/63375/1 "2023-07-01T03:12:03Z")

</div>

I have a complex CRM App developed. From the Client Screen users can open a Tasks and Notes Form and add tasks and notes to the client record. These are stored in a different worksheet in the same Google Sheet as client data as they are multivalued i.e. multiple tasks and notes per client.

I include the client email to identify which client the note or task belongs to.

Under the form button I need to display a list of tasks or notes. I have added a Collection from the respective worksheet under each button. Problem is I cant find a way to compare the client email from the client record with the client email on the task (or note) so it just displays all tasks or notes in the sheet.

Any ideas how to provide a list of tasks and notes for just the current client. These need to be editable as well when clicked.

---

<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:** [July 1, 2023, 3:22am UTC](https://community.glideapps.com/t/adding-collections-to-crm-form/63375/2 "2023-07-01T03:22:02Z")

</div>

You should be able to create a relation in the Clients table that links the email to the email in the tasks/notes table. Then source your collection from that relation.

---

<div class="post-metadata">

**Author:** ![gbigelowtutordoctor](https://avatars.discourse-cdn.com/v4/letter/g/9e8a1a/32.png) [@gbigelowtutordoctor](https://community.glideapps.com/u/gbigelowtutordoctor)\
**Post date:** [July 1, 2023, 4:00am UTC](https://community.glideapps.com/t/adding-collections-to-crm-form/63375/3 "2023-07-01T04:00:05Z")

</div>

I created the relation column but what do you mean by “Then source your collection from that relation.”

When I add a collection the only option is to specify which table it comes from. I cant see anywhere to relate to a relation in the Clients table. Im missing something I think

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [July 1, 2023, 4:09am UTC](https://community.glideapps.com/t/adding-collections-to-crm-form/63375/4 "2023-07-01T04:09:23Z")

</div>

In order to use a relation as the source of a Collection, the relation must be in the same table that the screen is attached to (or in the User Profile table). Assuming that is true, then when you set the source of the collection you should first see a list of tables. At the end of the list, you should see any relations/queries that can be used.

---

<div class="post-metadata">

**Author:** ![gbigelowtutordoctor](https://avatars.discourse-cdn.com/v4/letter/g/9e8a1a/32.png) [@gbigelowtutordoctor](https://community.glideapps.com/u/gbigelowtutordoctor)\
**Post date:** [July 1, 2023, 11:22pm UTC](https://community.glideapps.com/t/adding-collections-to-crm-form/63375/5 "2023-07-01T23:22:22Z")

</div>

“the relation must be in the same table that the screen is attached to”

The Clients Screen attaches to the Clients table. I have a relation there between the email on the Clients table and the email on the Tasks table. If I create a Collection I can see a list of tables in the google sheet , the Users Table and User Profile. There are no relations listed.

If I create the relation in the Tasks table I can select this relation from the list. You need a filter = Client Email Relation is not empty to produce a collection list.

So this approach will work it seems

Thanks again Darren!

---

<div class="post-metadata">

**Author:** ![gbigelowtutordoctor](https://avatars.discourse-cdn.com/v4/letter/g/9e8a1a/32.png) [@gbigelowtutordoctor](https://community.glideapps.com/u/gbigelowtutordoctor)\
**Post date:** [July 1, 2023, 11:29pm UTC](https://community.glideapps.com/t/adding-collections-to-crm-form/63375/6 "2023-07-01T23:29:04Z")

</div>

OK. One more thing. I deleted the Email relation from the Clients table and it stopped working so put it back in and that made it work. Delete the one from the tasks table and stopped working again. It seems you have to have a relation columns between the linked columns in both tables for it to work properly.

---

<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:** [July 1, 2023, 11:40pm UTC](https://community.glideapps.com/t/adding-collections-to-crm-form/63375/7 "2023-07-01T23:40:28Z")

</div>

That sounds like you have something set up wrong, or are misunderstanding. You only need one relation for it to work. Just make sure it’s a multiple relation.

Relations are not dependent on being set up in both tables. A relation should work just fine in one table.

---

<div class="post-metadata">

**Author:** ![gbigelowtutordoctor](https://avatars.discourse-cdn.com/v4/letter/g/9e8a1a/32.png) [@gbigelowtutordoctor](https://community.glideapps.com/u/gbigelowtutordoctor)\
**Post date:** [July 2, 2023, 1:23am UTC](https://community.glideapps.com/t/adding-collections-to-crm-form/63375/8 "2023-07-02T01:23:29Z")

</div>

Just checked again. If I remove the Tasks to Client relation the collection displays nothing. When I put it back it works perfectly.

---

<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:** [July 2, 2023, 2:30am UTC](https://community.glideapps.com/t/adding-collections-to-crm-form/63375/9 "2023-07-02T02:30:55Z")

</div>

Might need some screenshots because something doesn’t sound right.

---

<div class="post-metadata">

**Author:** ![gbigelowtutordoctor](https://avatars.discourse-cdn.com/v4/letter/g/9e8a1a/32.png) [@gbigelowtutordoctor](https://community.glideapps.com/u/gbigelowtutordoctor)\
**Post date:** [July 2, 2023, 2:45am UTC](https://community.glideapps.com/t/adding-collections-to-crm-form/63375/10 "2023-07-02T02:45:49Z")

</div>

Happy to send, but its working.

Tell me what you want shots of and I will send them soon

---

<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:** [July 2, 2023, 2:55am UTC](https://community.glideapps.com/t/adding-collections-to-crm-form/63375/11 "2023-07-02T02:55:56Z")

</div>

Probably shots of your relation configurations and shots of your collection configuration for starters.

---

<div class="post-metadata">

**Author:** ![gbigelowtutordoctor](https://avatars.discourse-cdn.com/v4/letter/g/9e8a1a/32.png) [@gbigelowtutordoctor](https://community.glideapps.com/u/gbigelowtutordoctor)\
**Post date:** [July 2, 2023, 3:20am UTC](https://community.glideapps.com/t/adding-collections-to-crm-form/63375/12 "2023-07-02T03:20:26Z")

</div>

Happy to provide login credentials if you want

---

<div class="post-metadata">

**Author:** ![gbigelowtutordoctor](https://avatars.discourse-cdn.com/v4/letter/g/9e8a1a/32.png) [@gbigelowtutordoctor](https://community.glideapps.com/u/gbigelowtutordoctor)\
**Post date:** [July 2, 2023, 5:16am UTC](https://community.glideapps.com/t/adding-collections-to-crm-form/63375/13 "2023-07-02T05:16:55Z")

</div>

Configs for the two relation columns and the Tasks Collection

 ![relations1](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/a/6a6a8eb7abf2e190cd9733c868b209528313977d.png)  
 ![relations2](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/e/beaf4f2a59297d503a3668741a80374a6f4f9f38.png)  
 ![relations3](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/e/5/e5b9de82a1d77cb9af5c650401797722d02bf314.png)

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [July 2, 2023, 5:44am UTC](https://community.glideapps.com/t/adding-collections-to-crm-form/63375/14 "2023-07-02T05:44:26Z")

</div>

Okay, your relation in the Tasks table (Client Email Relation) isn’t actually required for the Collection to work. However, as that’s a single relation back to your Clients table, you would use that to retrieve Client attributes such as Name, Avatar, etc (via Lookups), so that those attributes could be used as Collection labels. So it makes sense to have it there.

Does that make sense?

---

<div class="post-metadata">

**Author:** ![gbigelowtutordoctor](https://avatars.discourse-cdn.com/v4/letter/g/9e8a1a/32.png) [@gbigelowtutordoctor](https://community.glideapps.com/u/gbigelowtutordoctor)\
**Post date:** [July 2, 2023, 9:32am UTC](https://community.glideapps.com/t/adding-collections-to-crm-form/63375/15 "2023-07-02T09:32:45Z")

</div>

Yep understood. But trust me, if I remove the reverse relation column im the Tasks table the Collection no longer provides any resutls. Do do do do, do do do do!!! 🙂

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [July 2, 2023, 10:09am UTC](https://community.glideapps.com/t/adding-collections-to-crm-form/63375/16 "2023-07-02T10:09:19Z")

</div>

I don’t doubt you, but that’s not normal. There will be a reason for that, but difficult to say what it is without seeing your App. Do you have any filters on the Collection?
