# Choice component with multiple selection for many-to-many relationships

**URL:** <https://community.glideapps.com/t/choice-component-with-multiple-selection-for-many-to-many-relationships/54016>\
**Category:** Ask for Help\
**Created:** [November 12, 2022, 7:15pm UTC](https://community.glideapps.com/t/choice-component-with-multiple-selection-for-many-to-many-relationships/54016 "2022-11-12T19:15:52Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wisdom\_seeker](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/wisdom_seeker/32/50356_2.png) [@Wisdom\_seeker](https://community.glideapps.com/u/Wisdom_seeker)\
**Post date:** [November 12, 2022, 7:15pm UTC](https://community.glideapps.com/t/choice-component-with-multiple-selection-for-many-to-many-relationships/54016/1 "2022-11-12T19:15:52Z")

</div>

Hi Everyone,

I am new to Glide and I want to use Choice component to capture user’s multiple selection as it seems efficient and user-friendly. As I see it is entered to a single cell in Glide tables. The problem is that I want to enter the selections into a junction table to manage many-to-many relationships. As I understand multiple values in a single cell cannot be split and for the junction table I need separate rows for each selection. So I am not sure if Choice component can be used in my case.  
I want users to be able to select multiple hobbies from a pre-defined list. Then the user can see other users with intersecting interest in hobbies (if having any of the hobbies in common).  
What is the best way to approach this problem while keeping the selection options flexible/extendable and the selection process user-friendly?

Thanks for any guidance in advance.

---

<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:** [November 12, 2022, 7:19pm UTC](https://community.glideapps.com/t/choice-component-with-multiple-selection-for-many-to-many-relationships/54016/2 "2022-11-12T19:19:08Z")

</div>

> [@Wisdom\_seeker](#):
>
> multiple values in a single cell cannot be split

You can split it. Use a Split Text column to split the comma delimited list of selections into an array. Then you can use the Split Text Array in a Relation column.

---

<div class="post-metadata">

**Author:** ![Wisdom\_seeker](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/wisdom_seeker/32/50356_2.png) [@Wisdom\_seeker](https://community.glideapps.com/u/Wisdom_seeker)\
**Post date:** [November 12, 2022, 9:17pm UTC](https://community.glideapps.com/t/choice-component-with-multiple-selection-for-many-to-many-relationships/54016/3 "2022-11-12T21:17:57Z")

</div>

Thanks Jeff\_Hager for the great tip. 👍 🎖

---

<div class="post-metadata">

**Author:** ![Wisdom\_seeker](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/wisdom_seeker/32/50356_2.png) [@Wisdom\_seeker](https://community.glideapps.com/u/Wisdom_seeker)\
**Post date:** [November 13, 2022, 1:49pm UTC](https://community.glideapps.com/t/choice-component-with-multiple-selection-for-many-to-many-relationships/54016/4 "2022-11-13T13:49:39Z")

</div>

HI Jeff\_Hager,

I think I am stuck again. How can I find the intersection of 2 arrays. I managed to create the Split Text Array, but now I realized that with logical if else I cannot compare User’s interest array with other users’ interest array, since contains does not work for intersections. Do you have another good tip for me?  
Thanks again

---

<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:** [November 13, 2022, 2:42pm UTC](https://community.glideapps.com/t/choice-component-with-multiple-selection-for-many-to-many-relationships/54016/5 "2022-11-13T14:42:54Z")

</div>

> [@Wisdom\_seeker](#):
>
> How can I find the intersection of 2 arrays.

Does either array contain duplicates?  
If they don’t, you could do this in two steps.  
Firstly, combine both into a single array. You can do that with either the [Make Array](https://www.glideapps.com/docs/reference/computed-columns/make-array) column or the [Append Array](https://www.glideapps.com/plugins/concat-array) plugin. Then secondly, use the Duplicated Items plugin to find the duplicates in your combined array. The result of this will be the intersection of your two arrays.

---

<div class="post-metadata">

**Author:** ![Wisdom\_seeker](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/wisdom_seeker/32/50356_2.png) [@Wisdom\_seeker](https://community.glideapps.com/u/Wisdom_seeker)\
**Post date:** [November 13, 2022, 3:13pm UTC](https://community.glideapps.com/t/choice-component-with-multiple-selection-for-many-to-many-relationships/54016/6 "2022-11-13T15:13:59Z")

</div>

Thanks Darren\_Murphy,  
I will try to follow the steps you recommended. The arrays don’t have duplicates fortunately. 😺

---

<div class="post-metadata">

**Author:** ![Wisdom\_seeker](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/wisdom_seeker/32/50356_2.png) [@Wisdom\_seeker](https://community.glideapps.com/u/Wisdom_seeker)\
**Post date:** [November 13, 2022, 3:29pm UTC](https://community.glideapps.com/t/choice-component-with-multiple-selection-for-many-to-many-relationships/54016/7 "2022-11-13T15:29:00Z")

</div>

Darren\_Murphy that worked perfectly. Thanks for your help. 🎖 👍

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [November 14, 2022, 3:29pm UTC](https://community.glideapps.com/t/choice-component-with-multiple-selection-for-many-to-many-relationships/54016/8 "2022-11-14T15:29:37Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
