Iterate over iteration/collection (i.e. loop over a loop)?

Is it possible to set up Postman to loop over a loop?

I have a collection established that uses a data file to iterate over a series of IDs (roughly 100 or so). These IDs are used with the API endpoints in my collection. A user ID is targeted at the beginning of the collection run through a collection variable, followed by Postman iterating over the IDs in the data file.

The general idea is that the collection takes care of associating a series of data relationships with a specific user, rather than establishing these relationships one-at-a-time using the platform’s UI.

I’d like to take this one step further and be able to target multiple users instead of one-at-a-time. In other words, multiple user IDs would be identified on the front-end, followed by looping over each one, to then loop through the 100 IDs/endpoints already established in the collection.

Hi @Shrimpy85

Do you want to iterate the collections folder ? or only the requests that inside the collection ?

If you want to run the API one after the other in an iterative manner,

  1. You can add that API to a collection. Export the collection as a .json file
  2. Then you can use the Newman utility of Postman to iterate it as many times as you want for more information you can refer this page

Running collections on the command line with Newman | Postman Learning Center.