# FilterBy Bool Mask More than one criteria

**URL:** <https://forum.dynamobim.com/t/filterby-bool-mask-more-than-one-criteria/94156>\
**Category:** Revit\
**Tags:** revit, dynamo\
**Created:** [September 29, 2023, 3:40pm UTC](https://forum.dynamobim.com/t/filterby-bool-mask-more-than-one-criteria/94156 "2023-09-29T15:40:53Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![colby.turybury](https://avatars.discourse-cdn.com/v4/letter/c/4491bb/32.png) [@colby.turybury](https://forum.dynamobim.com/u/colby.turybury)\
**Post date:** [September 29, 2023, 3:40pm UTC](https://forum.dynamobim.com/t/filterby-bool-mask-more-than-one-criteria/94156/1 "2023-09-29T15:40:53Z")

</div>

In my image below I have a list with with 23 different lines of text. I also have a UI using datashapes that shows 5 options to choose from. When the UI comes up I will choose more than one option and click the accept button on the Data Shape UI. If I choose one option the filtering works great and the filterbyboolmask will filter the text properly. However, if I choose more than one option in the UI it wont use both in the boolean mask. How do I get the filterbyboolmask to see more than one option and make those options true within the list instead of just one?

 ![UIFilterTest](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/0/502d37c2cb3e16deabf502122b9e37cbf72e23d6.png)

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [September 29, 2023, 4:08pm UTC](https://forum.dynamobim.com/t/filterby-bool-mask-more-than-one-criteria/94156/2 "2023-09-29T16:08:01Z")

</div>

`FilterByBoolMask` takes _one_ list of items and _one_ list of booleans to filter into true/false groupings.

One option for multiple filters is to use list levels to filter your data multiple times (for each condition) and then flatten those individual results back into a single list. This is super straightforward and easy but does reorder your original list based on the order of the conditions.

Another option is to use an `OR` conditional to determine if an item meets _any_ of the conditions you have set. This would reduce your multiple conditional results down to a single list of booleans that would align with the single list of items to filter. This is done before the `FilterByBoolMask` node and retains the original list order.

---

<div class="post-metadata">

**Author:** ![colby.turybury](https://avatars.discourse-cdn.com/v4/letter/c/4491bb/32.png) [@colby.turybury](https://forum.dynamobim.com/u/colby.turybury)\
**Post date:** [September 29, 2023, 4:26pm UTC](https://forum.dynamobim.com/t/filterby-bool-mask-more-than-one-criteria/94156/3 "2023-09-29T16:26:00Z")

</div>

The Or statement sound the most promising. Because I do want to keep the order. Are you saying place and Or between the form++ and String Contains?

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [September 29, 2023, 4:32pm UTC](https://forum.dynamobim.com/t/filterby-bool-mask-more-than-one-criteria/94156/4 "2023-09-29T16:32:26Z")

</div>

An `OR` statement works by checking to see if any two (or more) inputs are true. You would want to pass each conditional value (per item) into an `OR` statement to see if the item passes _any_ of the conditions.

Dynamo actually has a node specifically for multiple conditions called `List.AnyTrue` that checks to see if any value in a list is true. This would do exactly what you want.

---

<div class="post-metadata">

**Author:** ![colby.turybury](https://avatars.discourse-cdn.com/v4/letter/c/4491bb/32.png) [@colby.turybury](https://forum.dynamobim.com/u/colby.turybury)\
**Post date:** [September 29, 2023, 7:49pm UTC](https://forum.dynamobim.com/t/filterby-bool-mask-more-than-one-criteria/94156/5 "2023-09-29T19:49:37Z")

</div>

Here is what I went with. The whole purpose was to create 3d views and apply a view template. We use these views in model coordination on ACC. I pull views from a template revit model that holds the 3d views. Load in the view templates. Transfer them to current model. Then based on choices from Data Shapes create the necessary 3d views and apply the appropriate view template

 ![3dCoordinationViewCreate](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/6/868cf81d404482d63704d51a59a21868de63dafa.png)

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [September 29, 2023, 7:54pm UTC](https://forum.dynamobim.com/t/filterby-bool-mask-more-than-one-criteria/94156/6 "2023-09-29T19:54:15Z")

</div>

Unfortunately your graph is illegible at that scale, but it looks like you have it working with `List.AnyTrue`.

---

<div class="post-metadata">

**Author:** ![colby.turybury](https://avatars.discourse-cdn.com/v4/letter/c/4491bb/32.png) [@colby.turybury](https://forum.dynamobim.com/u/colby.turybury)\
**Post date:** [September 29, 2023, 8:24pm UTC](https://forum.dynamobim.com/t/filterby-bool-mask-more-than-one-criteria/94156/7 "2023-09-29T20:24:26Z")

</div>

You can click it and it will increase in size.

---

<div class="post-metadata">

**Author:** ![pyXam](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/pyxam/32/163009_2.png) [@pyXam](https://forum.dynamobim.com/u/pyXam)\
**Post date:** [September 29, 2023, 10:07pm UTC](https://forum.dynamobim.com/t/filterby-bool-mask-more-than-one-criteria/94156/8 "2023-09-29T22:07:19Z")

</div>

Try it and seee what it looks like.
