# Read a list of booleans and change to other booleans list depending on the combination obtained

**URL:** <https://forum.dynamobim.com/t/read-a-list-of-booleans-and-change-to-other-booleans-list-depending-on-the-combination-obtained/35628>\
**Category:** Revit\
**Tags:** dynamo\
**Created:** [May 6, 2019, 6:40pm UTC](https://forum.dynamobim.com/t/read-a-list-of-booleans-and-change-to-other-booleans-list-depending-on-the-combination-obtained/35628 "2019-05-06T18:40:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![joaoluiz.sribeiro](https://avatars.discourse-cdn.com/v4/letter/j/71c47a/32.png) [@joaoluiz.sribeiro](https://forum.dynamobim.com/u/joaoluiz.sribeiro)\
**Post date:** [May 6, 2019, 6:40pm UTC](https://forum.dynamobim.com/t/read-a-list-of-booleans-and-change-to-other-booleans-list-depending-on-the-combination-obtained/35628/1 "2019-05-06T18:40:16Z")

</div>

Hi Guys!  
Does someone know how I can read an existing list and create another one depending on the number of “true” and “false”?.

For example, if I have 2 true and 1 false, I want dynamo to write in the list “true”, but if I have 2 “false” 1 “true”, I want dynamo to write “false”.  
They needed to compare 3 lists to obtain the result and after that write the list like the original.(ex:,list1/Index0 - 3 true = true)  
I tried to create something using binary numbers and “if”, but I don’t have any success because they don’t return the style of the original list. =/

Can someone help me?

IDEA:

 ![Capturar](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/3/736b4c122431d0087bef91ee8a7621ee688f74a8.png)

TRY:

 ![2](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/3/2/328a70504d5602442e320de3a1cca8fdaa7b0786.png)

---

<div class="post-metadata">

**Author:** ![Alban\_de\_Chasteigner](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alban_de_chasteigner/32/39650_2.png) [@Alban\_de\_Chasteigner](https://forum.dynamobim.com/u/Alban_de_Chasteigner)\
**Post date:** [May 6, 2019, 7:38pm UTC](https://forum.dynamobim.com/t/read-a-list-of-booleans-and-change-to-other-booleans-list-depending-on-the-combination-obtained/35628/2 "2019-05-06T19:38:22Z")

</div>

Hi @joaoluiz.sribeiro,

An If statement could help you.

 ![If%20statement](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/f/8f6947212eeeacfedbcd76cf1707279e94e4346c.png)

```
x=="1"||x=="11"?
true:
x=="0"||x=="00"||x=="01"||x=="10"?
false:
x;
```

---

<div class="post-metadata">

**Author:** ![joaoluiz.sribeiro](https://avatars.discourse-cdn.com/v4/letter/j/71c47a/32.png) [@joaoluiz.sribeiro](https://forum.dynamobim.com/u/joaoluiz.sribeiro)\
**Post date:** [May 6, 2019, 11:46pm UTC](https://forum.dynamobim.com/t/read-a-list-of-booleans-and-change-to-other-booleans-list-depending-on-the-combination-obtained/35628/3 "2019-05-06T23:46:28Z")

</div>

Thanks, @Alban_de_Chasteigner!!  
Works for me!! =)

 ![Capturar](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/b/8/b8ca49f269f9bb58e31c9ab216ba087bfb50e9d9.png)
