# List with "Errors" and Elemets - How to get just the element

**URL:** <https://forum.dynamobim.com/t/list-with-errors-and-elemets-how-to-get-just-the-element/81514>\
**Category:** Lists-Logic\
**Tags:** dynamo, error\
**Created:** [September 27, 2022, 11:53am UTC](https://forum.dynamobim.com/t/list-with-errors-and-elemets-how-to-get-just-the-element/81514 "2022-09-27T11:53:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bgumPXZJF](https://avatars.discourse-cdn.com/v4/letter/b/3be4f8/32.png) [@bgumPXZJF](https://forum.dynamobim.com/u/bgumPXZJF)\
**Post date:** [September 27, 2022, 11:53am UTC](https://forum.dynamobim.com/t/list-with-errors-and-elemets-how-to-get-just-the-element/81514/1 "2022-09-27T11:53:20Z")

</div>

Hi there. This should be an easy one.  
I used Rhythm Viewport.Create to create a viewport on a sheet. The result from this returns a lists as shown in the image below.

I would like to extract the element(s) that was created by the Viewport.Create function. How do I loop thru the list and just return the valid elements? In this example, All of the other elements read “Error: View XYZ can not be added…”. I want to throw these away and just get the valid elements. It is possible that the list can return more than 1 valid element?

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/7/078b31b635d96618b6ce92bcb27dba556816c6cd.png)

* * *

For context, I am inserting details onto sheets that have same names as the sheet. I am then repositioning it to a desired coordinate view the use of BoundingBox to figure out where the center of the viewport is and where it actually needs to be.

---

<div class="post-metadata">

**Author:** ![Draxl\_Andreas](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/draxl_andreas/32/145744_2.png) [@Draxl\_Andreas](https://forum.dynamobim.com/u/Draxl_Andreas)\
**Post date:** [September 27, 2022, 12:34pm UTC](https://forum.dynamobim.com/t/list-with-errors-and-elemets-how-to-get-just-the-element/81514/2 "2022-09-27T12:34:28Z")

</div>

@bgumPXZJF ,

can you preselect views not on sheets… i think there are plenty topics regarding that…

 ![grafik](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/e/6e9aefe5df0a8bf9001b7caa75b7c23968a9661c.png)

---

<div class="post-metadata">

**Author:** ![m.owens](https://avatars.discourse-cdn.com/v4/letter/m/bbe5ce/32.png) [@m.owens](https://forum.dynamobim.com/u/m.owens)\
**Post date:** [September 27, 2022, 5:43pm UTC](https://forum.dynamobim.com/t/list-with-errors-and-elemets-how-to-get-just-the-element/81514/3 "2022-09-27T17:43:53Z")

</div>

I assume these errors are strings. You could filter by string, which will likely create a null…but then you could filter by isnull.

Otherwise, get the data type and then filter based on data type.
