Hi Karthik,
I don't think the issue here is related to conditions. As I understand it, the data source returns all TEAMIDs sorted by POS. In this case, getMembers() should correctly retrieve the TEAMID members but the problem is that the sort order based on POS is not respected. I can't think of a simple solution using only standard functionality so have suggested replicating the sort order using the Design Studio SDK Collection Utility Component.
Regards,
Mustafa.