# Element.SetParameterByName Not working with lists as input

**URL:** <https://forum.dynamobim.com/t/element-setparameterbyname-not-working-with-lists-as-input/93204>\
**Category:** Revit\
**Created:** [August 25, 2023, 4:15pm UTC](https://forum.dynamobim.com/t/element-setparameterbyname-not-working-with-lists-as-input/93204 "2023-08-25T16:15:59Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![santrod0204](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/santrod0204/32/129842_2.png) [@santrod0204](https://forum.dynamobim.com/u/santrod0204)\
**Post date:** [August 25, 2023, 4:15pm UTC](https://forum.dynamobim.com/t/element-setparameterbyname-not-working-with-lists-as-input/93204/1 "2023-08-25T16:15:59Z")

</div>

I’m trying to use the node “Element.SetParameterByName” with two lists, but whenever I run the script it only works with the first Item of each list. Both lists count the same number of items and each list is placed for one of the inputs (parameterName and value). I have tried all the options for lacing and even flattening (something that I can’t flatten anymore).

It may be a basic question, but I’d appreciate it if someone could give me a hand with this.

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

---

<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:** [August 25, 2023, 4:27pm UTC](https://forum.dynamobim.com/t/element-setparameterbyname-not-working-with-lists-as-input/93204/2 "2023-08-25T16:27:00Z")

</div>

It’s always helpful to show _all_ the inputs for a node you’re having trouble with. I’d guess this is a list structure issue. Your element list is probably a list of lists. Either way, you’ll need to use list levels (`element@L1`) to ensure that all elements in the list get supplied the whole list of parameters/values.

---

<div class="post-metadata">

**Author:** ![Vikram\_Subbaiah](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vikram_subbaiah/32/50797_2.png) [@Vikram\_Subbaiah](https://forum.dynamobim.com/u/Vikram_Subbaiah)\
**Post date:** [August 25, 2023, 4:30pm UTC](https://forum.dynamobim.com/t/element-setparameterbyname-not-working-with-lists-as-input/93204/3 "2023-08-25T16:30:48Z")

</div>

> [@santrod0204](#):
>
> I have tried all the options for lacing and even flattening

Click on the little arrows besides the input labels and explore _Levels_

While your _parameter name_ and _value_ list lengths match, you most probably are feeding one _element_

---

<div class="post-metadata">

**Author:** ![santrod0204](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/santrod0204/32/129842_2.png) [@santrod0204](https://forum.dynamobim.com/u/santrod0204)\
**Post date:** [August 25, 2023, 4:35pm UTC](https://forum.dynamobim.com/t/element-setparameterbyname-not-working-with-lists-as-input/93204/4 "2023-08-25T16:35:05Z")

</div>

Hi @Nick_Boyts and @Vikram_Subbaiah, thanks for your help! It’s working now (both answers helped me a lot).

---

<div class="post-metadata">

**Author:** ![claracoutoCD8EP](https://avatars.discourse-cdn.com/v4/letter/c/cc9497/32.png) [@claracoutoCD8EP](https://forum.dynamobim.com/u/claracoutoCD8EP)\
**Post date:** [August 31, 2023, 7:51pm UTC](https://forum.dynamobim.com/t/element-setparameterbyname-not-working-with-lists-as-input/93204/5 "2023-08-31T19:51:43Z")

</div>

I´m having the same problem, but it`s still not working for me.

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

Do you know what is going on?!

I have tried this as well:

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/0/408299c5904edad7690ef9f39b5873fcb1c51673.png)

But it is still not Working.

---

<div class="post-metadata">

**Author:** ![Vikram\_Subbaiah](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vikram_subbaiah/32/50797_2.png) [@Vikram\_Subbaiah](https://forum.dynamobim.com/u/Vikram_Subbaiah)\
**Post date:** [September 1, 2023, 2:00am UTC](https://forum.dynamobim.com/t/element-setparameterbyname-not-working-with-lists-as-input/93204/6 "2023-09-01T02:00:53Z")

</div>

You have your inputs all wrong, need to provide a list of elements, not integers  
The same is indicated in the error message.  
Your other two inputs are probably wrong too  
.  
Once you have that sorted, if you need levels to be manipulated, there are multiple variations you could attempt. All don’t have to be activated and they can be something other than @L1. However your issue, at present, has got nothing to do with levels.

Please also start a fresh topic if you still have issues as this one is closed

---

<div class="post-metadata">

**Author:** ![claracoutoCD8EP](https://avatars.discourse-cdn.com/v4/letter/c/cc9497/32.png) [@claracoutoCD8EP](https://forum.dynamobim.com/u/claracoutoCD8EP)\
**Post date:** [September 1, 2023, 4:35am UTC](https://forum.dynamobim.com/t/element-setparameterbyname-not-working-with-lists-as-input/93204/7 "2023-09-01T04:35:43Z")

</div>

Thank you very much for your response. In fact, I’m just starting to explore this tool and I don’t really understand much of this language, so I assumed that my issue was the same as this one.

In fact, what I’m trying to do is to filter my Revit model twice, first by category and then by a parameter value. But I don’t know how to apply this double filter in order to obtain a list of elements. Anyway, I’m pretty sure that my other 2 inputs are correct cuz I’ve tried them before with an actual List of elements (and without the Levels applied) Thank you once again for your help.
