Have a look at the following topic which has an example of using a loop.
Multiple test case with a condition - Just getting started - Postman
Have a look at the following topic which has an example of using a loop.
Multiple test case with a condition - Just getting started - Postman