Using WhileLoop

Hello,
I need to run a Function (green gruop) for each element in list (Data node on the beginning).
I created such a WhileLoop, but it doesn’t work. The output is run the Function only for the last element .

Does anyone had such problems with WhileLoop? Do You have any nice exapmle of usage of WhileLoop?
Maybe there is a possiblity to do it with using a PythonScript Node?
Thanks

Can’t read your nodes due to how the image was created. Zoom in so we can see clearly and export the image using the Export Canvas as Image tool (either a camera icon or ‘export’ text just outside the top right corner of the workspace).

90% of the time you don’t need a while loop to iterate over any items in Dynamo; the built in lacing provided by Dynamo’s associative language model should cover you as is.

The dynamo dictionary has a great example of this node in action here: Dynamo Dictionary.

Thanks for reply.
Well, In my view I want to connect each Element of list separately to green group, so I need to use loop. How lacing might help me?

No need for the loop. Wire the list of property values directly into the propertyValue input of the ObjectByProperty node.

Thank You so much. I just connect the list and change lacing to Longest (in List.Count node) and then it works properly.