How to run for each element of the list

I’m trying to input parameter value to element use a python script.
When I used “Select Model Element” to enter parameters for only one element, it worked. But if I use “select model elements”, the list is created. In this case, some nodes display an empty list. So I am trying to use a loop. But the loop only gets the last item in the list. This is what i don’t want. I want every element of the list to follow the logic.Is there a good way? And I’m sorry I’m not good at English

Hi @losey9209,

Sounds like you aren’t appending your result to an output list, using the append() function.

But it’s much easier to help if you share your code :slight_smile:

Here is my dynamo logic. I thought the loopwhile node would put all the nodes into the getitemindex node. But it put the last item in the list. Would the append() function help me?

There is absolutely no need to make something like this in Dynamo, this is what your lists are doing inherently.

You can wire up your desired function straight from you list of elements, all the nodes in the picture except the first one can probably go.

Read up on lists, replication and list managment in the Dynamo Primer.