# Filter by (bool, bool)

**URL:** <https://forum.dynamobim.com/t/filter-by-bool-bool/80075>\
**Category:** Lists-Logic\
**Created:** [August 19, 2022, 10:08pm UTC](https://forum.dynamobim.com/t/filter-by-bool-bool/80075 "2022-08-19T22:08:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jaeho](https://avatars.discourse-cdn.com/v4/letter/j/e9bcb4/32.png) [@jaeho](https://forum.dynamobim.com/u/jaeho)\
**Post date:** [August 19, 2022, 10:08pm UTC](https://forum.dynamobim.com/t/filter-by-bool-bool/80075/1 "2022-08-19T22:08:34Z")

</div>

I want to get out put from different input bools combination.  
For examples, from if there are two boolean then make list like (Ture, False) then get a value or number by (bool, bool).  
How do I make the nodes or write something in a block?

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/8/1876edb769df4df7c91b9ea93669eaea2f35e308.png)

if the bools are (T,T) then result is 1, (T,F) = 2 (F,T), = 3, (F,F)=4 like these

---

<div class="post-metadata">

**Author:** ![GavinNicholls](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/gavinnicholls/32/190442_2.png) [@GavinNicholls](https://forum.dynamobim.com/u/GavinNicholls)\
**Post date:** [August 19, 2022, 10:54pm UTC](https://forum.dynamobim.com/t/filter-by-bool-bool/80075/2 "2022-08-19T22:54:15Z")

</div>

Run the booleans into two if nodes, where the first is 0 if true, 1 if false. For the second, 0 if true, 2 if false.

Put four outcomes into a list, then add the outcomes from the if nodes. We know that:

TT = 0  
FT = 1  
TF = 2  
FF = 3

So you can use this sum as an index. Feed that into a list.getitematindex node with your list of 4 options being the list.

---

<div class="post-metadata">

**Author:** ![AmolShah](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/amolshah/32/103244_2.png) [@AmolShah](https://forum.dynamobim.com/u/AmolShah)\
**Post date:** [August 20, 2022, 7:15am UTC](https://forum.dynamobim.com/t/filter-by-bool-bool/80075/3 "2022-08-20T07:15:55Z")

</div>

@jaeho You can do something like this with nested if:  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/2/725a175a41f35b9b41b19d8672f1477ecbcb307b.png)

```auto
in1 == true && in2 == true?1:
in1 == true && in2 == false?2:
in1 == false && in2 == true?3:
in1 == false && in2 == false?4:
"Check inputs";

```

---

<div class="post-metadata">

**Author:** ![christian.stan](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/christian.stan/32/166296_2.png) [@christian.stan](https://forum.dynamobim.com/u/christian.stan)\
**Post date:** [August 20, 2022, 9:32am UTC](https://forum.dynamobim.com/t/filter-by-bool-bool/80075/4 "2022-08-20T09:32:21Z")

</div>

Hello,  
another possibility

 ![20 Aout forum anglais rep3_2022-08-20_11-36-17](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/0/c058e6cf6d564ef320baec46350a1b593b3d8106.png)

Cordially  
christian.stan
