Importing data files

You can use data files to pass Postman sets of values to use in a collection run. By selecting a JSON or CSV data file in the Collection Runner, you can test your requests with multiple different values as part of a single run.

Running collections with data files

When you initiate a collection run you will see an option to select a data file. Click Runner at bottom right of Postman.

Collection Runner

Select your collection, then click Select File next to Data on the right to select your data file.

Data File Select

You will see an option to Preview the data in the file before starting the run.

Data File Preview

Click Run using data files to begin the run with the values from the file.

  • You can try out the steps in this page by first importing the sample collection—download and import it into Postman using the Import button at the top left.

Import Collection

  • In the Collection Runner, choose the collection you imported. Download the sample data file and select it in the Runner also.
  • Note that the sample collection contains a POST request which uses a path variable in the URL. This path variable is specified in each record in the data file. The request also uses a value variable in the body which is also pulled from the data file for each iteration. The example request is to the Postman Echo API, a learning resource that returns the data you send it.

The Collection Runner will run the collection requests for each iteration in the data file. The output you see will indicate the results for any tests you have defined in your collection requests.


Click a request in the Collection Runner results to see more detail on its data.

Collection Run Results

Any data you have defined in the requests will be used when the collection runs, and your request data can reference values defined in the data file.

Data File Value

Accessing data file values

You can reference values defined in the data file throughout your requests, however to access them in scripts, you need to use a different technique. To use values from the data file in your Tests or Pre-request Script code, use the iterationData, which provides access to the current data file record being used to run the request.

//get the 'value' field from the data file for this request run

See the Sandbox Reference for more on what you can do with iteration data.

Errors when reading data files

You may encounter errors when Postman attempts to read your data file during a collection run. If this happens, you can take the following steps.

  1. Ensure your data file is formatted correctly, as either CSV or JSON.

  2. Confirm your data file is encoded properly, by opening your data file in a text editor and saving the file in a different format.

If the errors persist, contact the Postman support team.

Next steps

To continue learning to leverage collection runs, check out the following resources:

Last modified: 2021/07/29