Hi Anjali,
What are you trying to achieve? With a List Operation (https://docs.mendix.com/refguide/list-operation) you can filter using a value of your choosing, among other functions. The result is a list of objects of which the attribute matches your value. This is a lot easier (and faster) than having to iterate over all objects using a loop.