It sounds like you might be using the new listview, or repeatables, which has a scope limitation:
Scope limitations: for performance reasons, we currently do not support indexing into components inside of a Repeatable to access their properties. Instead, we recommend adding event handlers to track state changes back to data in your Repeatables.
Your looping idea would work in the legacy listview, however: