# How to remove duplicates created from if statements being false

**URL:** <https://forum.dynamobim.com/t/how-to-remove-duplicates-created-from-if-statements-being-false/102291>\
**Category:** FAQ\
**Tags:** revit, dynamo\
**Created:** [June 27, 2024, 4:39pm UTC](https://forum.dynamobim.com/t/how-to-remove-duplicates-created-from-if-statements-being-false/102291 "2024-06-27T16:39:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![RV\_13](https://avatars.discourse-cdn.com/v4/letter/r/4af34b/32.png) [@RV\_13](https://forum.dynamobim.com/u/RV_13)\
**Post date:** [June 27, 2024, 4:39pm UTC](https://forum.dynamobim.com/t/how-to-remove-duplicates-created-from-if-statements-being-false/102291/1 "2024-06-27T16:39:50Z")

</div>

Hello everyone. I’m in the process of creating digital twins and running into a problem. This is what I’ve done until now:

1. Started by selecting the pretended element;
2. Got the family, the family type and then all the instances;
3. Got the expiry dates as strings, split them and turn them into dates;
4. With the time span difference node got the days between today and the expiry date and turned that into an integer;
5. Then I wrote a condition that if the result obtained in point 4 was lesser than 51 or null, it would return 404. If it wasnt it would return 1. Both 404 and 1 are used as numbers and not strings;
6. After that the goal is to get all the 404 and get their number id so it can be replaced. So I wrote another condition that goes: if it is 404 display number id, if not " ";

In this case, 4 of the extinguishers are expired. So I’d expect a list with 76 ones and 4 number id’s.  
But, for each of the expired ones, it’s duplicating every single one of its family instances.  
I end up getting one with 396 entries. Its doing 80\*4+(80-4).  
Can anyone understand why and how to fix it? Please and thank you

 ![P4dyn](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/1/017f89deb6a9084a0f0f4d87a2dcec5134064027.jpeg)

---

<div class="post-metadata">

**Author:** ![Mike.Buttery](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@Mike.Buttery](https://forum.dynamobim.com/u/Mike.Buttery)\
**Post date:** [June 28, 2024, 1:53am UTC](https://forum.dynamobim.com/t/how-to-remove-duplicates-created-from-if-statements-being-false/102291/2 "2024-06-28T01:53:29Z")

</div>

Hi @RV_13, welcome on board!

For each true in the _if_ node it will provide the entire list → 4 \* 80 `true` responses plus the 76 `false` responses.

Try with a _List.FilterByBoolMask_

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/3/5331bb680f668c91c76ca7a99d0588579b30809b.png)

---

<div class="post-metadata">

**Author:** ![RV\_13](https://avatars.discourse-cdn.com/v4/letter/r/4af34b/32.png) [@RV\_13](https://forum.dynamobim.com/u/RV_13)\
**Post date:** [June 28, 2024, 10:25am UTC](https://forum.dynamobim.com/t/how-to-remove-duplicates-created-from-if-statements-being-false/102291/3 "2024-06-28T10:25:24Z")

</div>

Thank you.
