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?
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.
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
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 column or the Append 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.