# Multiple selection not working when items are NOT adjacent in DYNAMIC FILTERS

**URL:** <https://community.glideapps.com/t/multiple-selection-not-working-when-items-are-not-adjacent-in-dynamic-filters/37935>\
**Category:** Ask for Help\
**Created:** [January 31, 2022, 6:43pm UTC](https://community.glideapps.com/t/multiple-selection-not-working-when-items-are-not-adjacent-in-dynamic-filters/37935 "2022-01-31T18:43:59Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![Katelyn\_Alberts](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/katelyn_alberts/32/44421_2.png) [@Katelyn\_Alberts](https://community.glideapps.com/u/Katelyn_Alberts)\
**Post date:** [January 31, 2022, 6:43pm UTC](https://community.glideapps.com/t/multiple-selection-not-working-when-items-are-not-adjacent-in-dynamic-filters/37935/1 "2022-01-31T18:43:59Z")

</div>

I have created multiple lists of filter categories for users to narrow down their choice of options. Some filter categories allow users to select multiple options within the same list. If the options they select are not adjacent in the list, it will display NO MATCHES

example: if options are 1,2,3,4,5 - and user selects that they want 1 and 4 - DOES NOT WORK  
example: if options are 1,2,3,4,5 - and user selects that they want 1 and 2 - it will work

Pictures for an example of: user selects 2 skills they are looking for. Three professionals MATCH these skill selections, but only ONE pops up, because the selections are adjacent in their column.

 ![filters](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/9/c/9c7b885bf5431729a85d0d2420f69098f0dd2699.png)  
 ![filters2](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/5/0526e81383da5fae4325eee2bd744a5ece8fe8b7.png)  
 ![filters3](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/c/3/c3680c6e938f5bdd0063a453162b8be7fe8dbb31.png)

---

<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:** [February 1, 2022, 1:33am UTC](https://community.glideapps.com/t/multiple-selection-not-working-when-items-are-not-adjacent-in-dynamic-filters/37935/2 "2022-02-01T01:33:46Z")

</div>

So when a user chooses highlights AND full blinding you only want to show stylists that have both 2?

---

<div class="post-metadata">

**Author:** ![Katelyn\_Alberts](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/katelyn_alberts/32/44421_2.png) [@Katelyn\_Alberts](https://community.glideapps.com/u/Katelyn_Alberts)\
**Post date:** [February 1, 2022, 2:30am UTC](https://community.glideapps.com/t/multiple-selection-not-working-when-items-are-not-adjacent-in-dynamic-filters/37935/3 "2022-02-01T02:30:06Z")

</div>

Yes exactly. I want users to be able to check off multiple criteria, whether it’s 2, 3, 4 specialties etc. and the stylists who specialize in all of those things will appear.

Currently it only allows for multiple specialties if they are adjacent, or subsequent.

---

<div class="post-metadata">

**Author:** ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)\
**Post date:** [February 1, 2022, 12:04pm UTC](https://community.glideapps.com/t/multiple-selection-not-working-when-items-are-not-adjacent-in-dynamic-filters/37935/4 "2022-02-01T12:04:37Z")

</div>

Hola,

I think this method can help you if you are going to use 4+ filters (btw… I tested your problem using my demo APP and everything worked ok) :

> [@Multi Filters using Relations: a new way bulb](https://community.glideapps.com/t/multi-filters-using-relations-a-new-way/36092):
>
> Hola, feliz día! Watching some threads and good [Robert Petitto’s](https://community.glideapps.com/t/use-multiple-choice-components-to-filter-an-inline-list/16932) videos about creating customized filters using an Inline List component, I thought an idea to make it simpler and avoid configuring manually the Inline List’s filter and suddenly, I got this to share wink: A way to have a wide Filter using the OR operator A narrow Filter using the AND operator I recorded a video to show and help to understand how this APP demo works and its procedure: [Loom | Free S…](https://www.loom.com/share/24af344081ff48aba9baf684e9a67be5)

Saludos

---

<div class="post-metadata">

**Author:** ![Katelyn\_Alberts](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/katelyn_alberts/32/44421_2.png) [@Katelyn\_Alberts](https://community.glideapps.com/u/Katelyn_Alberts)\
**Post date:** [February 2, 2022, 2:58pm UTC](https://community.glideapps.com/t/multiple-selection-not-working-when-items-are-not-adjacent-in-dynamic-filters/37935/5 "2022-02-02T14:58:59Z")

</div>

Hi @gvalero thank you so much for this information! While it is very similar to what I’m trying to create - I don’t think it is exactly the same. Let me see if I can explain…

The wide filter allows the results to only have SOME of the criteria in a filter section but not all…

For example: if you check off location Alcott rd AND downtown, it allows professionals to show up if they work at Alcot rd OR Downtown. I want mine to show the professionals that work at BOTH locations bc the user needs to go both locations.

This is currently how mine works EXCEPT if: let’s say Marie Rad said she worked at Alcott rd, downtown, AND beach locations but then a user only needed someone to who worked at Alcott and Beach… Glide misreads the criteria and says Marie Rad DOESN’T work at those locations bc in the database it reads Marie Rad works at “alcot rd,downtown,beach…” not the selection “alcot rd,beach”.

That’s what I was trying to show in my original photos. Hopefully that makes sense!! 🙏

---

<div class="post-metadata">

**Author:** ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)\
**Post date:** [February 2, 2022, 5:54pm UTC](https://community.glideapps.com/t/multiple-selection-not-working-when-items-are-not-adjacent-in-dynamic-filters/37935/6 "2022-02-02T17:54:33Z")

</div>

> [@Katelyn\_Alberts](#):
>
> I want mine to show the professionals that work at BOTH locations bc the user needs to go both locations.

Ah… I think now I follow you 🙃

In my demo, all users have an only one location, an only one title, etc and it isn’t covered.

Let me modify my database and play a while with your case to see if I can get something better for you.

Feliz día!

---

<div class="post-metadata">

**Author:** ![Katelyn\_Alberts](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/katelyn_alberts/32/44421_2.png) [@Katelyn\_Alberts](https://community.glideapps.com/u/Katelyn_Alberts)\
**Post date:** [February 2, 2022, 6:54pm UTC](https://community.glideapps.com/t/multiple-selection-not-working-when-items-are-not-adjacent-in-dynamic-filters/37935/7 "2022-02-02T18:54:04Z")

</div>

@gvalero THANK YOU, THANK YOU

---

<div class="post-metadata">

**Author:** ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)\
**Post date:** [February 5, 2022, 3:34pm UTC](https://community.glideapps.com/t/multiple-selection-not-working-when-items-are-not-adjacent-in-dynamic-filters/37935/8 "2022-02-05T15:34:53Z")

</div>

Hola @Katelyn_Alberts

I keep trying to find out a simple and useful solution for you.

I tested 2 workarounds but I guess these are tricky for your case.

Your idea fails because you are using the _ **includes** _ condition in your filter and when your selected services (or hair types or whatever) aren’t consecutive the string/text to be found doesn’t exist. I have an idea using an array for it, it should work and make the solution simple.

I let you know when I have the idea working.

Feliz día!

---

<div class="post-metadata">

**Author:** ![Katelyn\_Alberts](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/katelyn_alberts/32/44421_2.png) [@Katelyn\_Alberts](https://community.glideapps.com/u/Katelyn_Alberts)\
**Post date:** [February 5, 2022, 5:28pm UTC](https://community.glideapps.com/t/multiple-selection-not-working-when-items-are-not-adjacent-in-dynamic-filters/37935/9 "2022-02-05T17:28:37Z")

</div>

You are THE BEST. Thanks for keeping me updated and continuing to work on this!!!

---

<div class="post-metadata">

**Author:** ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)\
**Post date:** [February 5, 2022, 6:47pm UTC](https://community.glideapps.com/t/multiple-selection-not-working-when-items-are-not-adjacent-in-dynamic-filters/37935/10 "2022-02-05T18:47:24Z")

</div>

Hola de nuevo,

here we go…

I’m going to use another version of my database to make some analogies with yours. Here you can see that I selected 3 different locations and the Filter showed 2 people with this criteria. Although you case might need 2 options, I show you a case with 3 options (up to 3 locations) to understand better the process.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/7/d733b3831002744334d1e33def165838cd210389.png)

This is the step by step to follow:

1. Take data saved in your Service column (mine is called _u\_Location_ instead) by Choice component (multi selection) and create a new one based on it to have an array column.  
You must use **Split Text** type to get it.  
I called it _u\_Location[]_ but you can call your new column as _u\_Service[]_

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/4/b4f3c3add081f302dc7c26ee9f4eb6339549d8df.png)

1. Create 3 new columns using _ **Single Value** _ type in order to retrieve each value from _u\_Location[]_. Keep in mind this column is an array and starts from 0 to 2 (3 items)  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/8/d8f5b4215e24ff8949b0eb7bca08a7879147963d.png)

… This is how the 3rd column should look like.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/4/c/4c5b2e18333f34dda991ea2290089cf120bc75a5.png)

1. Ok… we almost finished 😇!

2. Set your Inline List’s filters to work with 3 new columns created in step #2 using the _ **includes** _ condition. Your multiple selection should work fine from now on.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/b/6b5c40535ab01a766f58ea669e588d2330a538d9.png)

My _Location_ column is equivalent to your _My Specialty Service_ column

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/5/a/5a52f0532334bf22fa1b305c6bf0e9282e758800.png)

I hope it helps you @Katelyn_Alberts , let me know any problem if my explanation was not clear.

Feliz día!

---

<div class="post-metadata">

**Author:** ![Katelyn\_Alberts](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/katelyn_alberts/32/44421_2.png) [@Katelyn\_Alberts](https://community.glideapps.com/u/Katelyn_Alberts)\
**Post date:** [February 6, 2022, 12:33am UTC](https://community.glideapps.com/t/multiple-selection-not-working-when-items-are-not-adjacent-in-dynamic-filters/37935/11 "2022-02-06T00:33:47Z")

</div>

Oh this looks good!! I’m going to try this out tomorrow!!! Hopefully i can follow, but i am also still somewhat new so I may get lost and need help 😇 i will let you know asap, thank you so much!

---

<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:** [February 6, 2022, 2:28am UTC](https://community.glideapps.com/t/multiple-selection-not-working-when-items-are-not-adjacent-in-dynamic-filters/37935/12 "2022-02-06T02:28:01Z")

</div>

Here’s my attempt to do this to choose however many items you need from the choice component:

> **[Multiple Selection](https://boundless-shop-9690.glideapp.io/)**

The idea is as below:

- Have a unique table to store all locations.
- Return a list of rowIDs that belongs to each location.
- When you choose a filter item, return that list of rowIDs, so ultimately what we have is an array of rowID arrays.
- I use JavaScript to return the rowIDs that appears in all child arrays (thus satisfying the AND condition).

---

<div class="post-metadata">

**Author:** ![Katelyn\_Alberts](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/katelyn_alberts/32/44421_2.png) [@Katelyn\_Alberts](https://community.glideapps.com/u/Katelyn_Alberts)\
**Post date:** [February 6, 2022, 4:37am UTC](https://community.glideapps.com/t/multiple-selection-not-working-when-items-are-not-adjacent-in-dynamic-filters/37935/13 "2022-02-06T04:37:38Z")

</div>

Thank you! I will try this asap as well!

---

<div class="post-metadata">

**Author:** ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)\
**Post date:** [February 6, 2022, 4:09pm UTC](https://community.glideapps.com/t/multiple-selection-not-working-when-items-are-not-adjacent-in-dynamic-filters/37935/14 "2022-02-06T16:09:32Z")

</div>

Hola Thind,

Smart idea, I was going to use something similar but I wanted to keep the solution easy based on Katelyn’s need and her knowledgement.

I didn’t want to confuse her with some JS code 😇

Chao, te cuidas!

---

<div class="post-metadata">

**Author:** ![Katelyn\_Alberts](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/katelyn_alberts/32/44421_2.png) [@Katelyn\_Alberts](https://community.glideapps.com/u/Katelyn_Alberts)\
**Post date:** [February 6, 2022, 6:47pm UTC](https://community.glideapps.com/t/multiple-selection-not-working-when-items-are-not-adjacent-in-dynamic-filters/37935/15 "2022-02-06T18:47:18Z")

</div>

YOU ARE A GENIUS. It works perfectly and I have adjusted all my filter categories. I also love that I can put a limit on how many selections are being acknowledged in the filter without having to limit how many specialties someone can have aka: if a user selects more than 5 specialties it’ll only acknowledge the first [5] bc that’s all I allowed for, but the professionals can have more than 5 specialties in their profile.

THANK YOU, THANK YOU!!!

---

<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:** [February 6, 2022, 11:36pm UTC](https://community.glideapps.com/t/multiple-selection-not-working-when-items-are-not-adjacent-in-dynamic-filters/37935/16 "2022-02-06T23:36:39Z")

</div>

> [@gvalero](#):
>
> I was going to use something similar but I wanted to keep the solution easy based on Katelyn’s need and her knowledgement.

Yeah, I agree with this, but I thought limiting the number of filters a user can use is not practical, so a more complex situation is proposed if she ever wants to come back in the future.

Yours is a great one.

---

<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:** [February 7, 2022, 11:36pm UTC](https://community.glideapps.com/t/multiple-selection-not-working-when-items-are-not-adjacent-in-dynamic-filters/37935/17 "2022-02-07T23:36:40Z")

</div>

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