# Obtain Only Items that are Double from List

**URL:** <https://forum.dynamobim.com/t/obtain-only-items-that-are-double-from-list/74030>\
**Category:** Uncategorized\
**Tags:** dynamo\
**Created:** [March 7, 2022, 2:00pm UTC](https://forum.dynamobim.com/t/obtain-only-items-that-are-double-from-list/74030 "2022-03-07T14:00:41Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![efyst2](https://avatars.discourse-cdn.com/v4/letter/e/b9e5f3/32.png) [@efyst2](https://forum.dynamobim.com/u/efyst2)\
**Post date:** [March 7, 2022, 2:00pm UTC](https://forum.dynamobim.com/t/obtain-only-items-that-are-double-from-list/74030/1 "2022-03-07T14:00:41Z")

</div>

Hi there,

May I know what’s the best way to obtain only items that appear as decimals/doubles in a list?

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/2/a223465ad53f467edb1142098c3ae89e0054f7cc.jpeg)

Thank you!

---

<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:** [March 7, 2022, 2:28pm UTC](https://forum.dynamobim.com/t/obtain-only-items-that-are-double-from-list/74030/2 "2022-03-07T14:28:05Z")

</div>

You should be able to use `Object.Type` to filter the items.

---

<div class="post-metadata">

**Author:** ![efyst2](https://avatars.discourse-cdn.com/v4/letter/e/b9e5f3/32.png) [@efyst2](https://forum.dynamobim.com/u/efyst2)\
**Post date:** [March 7, 2022, 3:25pm UTC](https://forum.dynamobim.com/t/obtain-only-items-that-are-double-from-list/74030/3 "2022-03-07T15:25:23Z")

</div>

Thank you for the help, I have another question after using the Object.Type node, how am I supposed to extract the items out after filtering them? I’m not sure what to put in the false input for ‘If’ node, and the list.filterbyboolmask node doesn’t seem to work. I understand that it’s the "null’ values that’s causing the warnings but I guess I am going to ignore them for now…

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/3/a39e9fc523716f2c800cbdba5304c30d80a2b5f6.jpeg)

Thank you 🙂

---

<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:** [March 7, 2022, 5:21pm UTC](https://forum.dynamobim.com/t/obtain-only-items-that-are-double-from-list/74030/4 "2022-03-07T17:21:27Z")

</div>

I would use a `FilterByBoolMask`. You still have to handle the null values, but then you would filter your original list by those booleans.

---

<div class="post-metadata">

**Author:** ![newshunhk](https://avatars.discourse-cdn.com/v4/letter/n/3bc359/32.png) [@newshunhk](https://forum.dynamobim.com/u/newshunhk)\
**Post date:** [March 7, 2022, 6:00pm UTC](https://forum.dynamobim.com/t/obtain-only-items-that-are-double-from-list/74030/5 "2022-03-07T18:00:48Z")

</div>

replacenull with false first at string.contains before filter

---

<div class="post-metadata">

**Author:** ![efyst2](https://avatars.discourse-cdn.com/v4/letter/e/b9e5f3/32.png) [@efyst2](https://forum.dynamobim.com/u/efyst2)\
**Post date:** [March 7, 2022, 6:39pm UTC](https://forum.dynamobim.com/t/obtain-only-items-that-are-double-from-list/74030/6 "2022-03-07T18:39:44Z")

</div>

Thank you!

---

<div class="post-metadata">

**Author:** ![gerhard.p](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/gerhard.p/32/147675_2.png) [@gerhard.p](https://forum.dynamobim.com/u/gerhard.p)\
**Post date:** [March 7, 2022, 8:33pm UTC](https://forum.dynamobim.com/t/obtain-only-items-that-are-double-from-list/74030/7 "2022-03-07T20:33:37Z")

</div>

Hello @efyst2

To make a script with datashapes UI work good i would recommend to test your outputs before passing them to other nodes.  
If a user cancels the UI, closes the UI or gives no inputs, the script should stop running by passing an empty list.

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

And you can even adapt such a test-codeblock for any other needs:

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/4/74e2986e59c2d2e8c4cbfefb73b3d9753f1eeeff.png)

```auto
x;
[Imperative]
{
	return (List.IsEmpty(x))? []:
	(x==null)? []: x;
};

```

---

<div class="post-metadata">

**Author:** ![solamour](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/solamour/32/153516_2.png) [@solamour](https://forum.dynamobim.com/u/solamour)\
**Post date:** [March 7, 2022, 9:54pm UTC](https://forum.dynamobim.com/t/obtain-only-items-that-are-double-from-list/74030/8 "2022-03-07T21:54:35Z")

</div>

You can also use the `List.RemoveIfNot` node, which essentially filters out anything that is not of your chosen type 🙂

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

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/d/9/d9c4425edf8bd2736eccd0574a3b27ca09d8bad6.png)

---

<div class="post-metadata">

**Author:** ![efyst2](https://avatars.discourse-cdn.com/v4/letter/e/b9e5f3/32.png) [@efyst2](https://forum.dynamobim.com/u/efyst2)\
**Post date:** [March 10, 2022, 11:53am UTC](https://forum.dynamobim.com/t/obtain-only-items-that-are-double-from-list/74030/9 "2022-03-10T11:53:00Z")

</div>

Thank you for all the useful tips!! 😃
