> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://learning.postman.com/llms.txt.

# Use a data file with a monitor

Custom data files are available on Postman paid plans. For more information, see the [pricing page](https://www.postman.com/pricing/).

You can upload a data file to pass different sets of values to your requests and scripts during a [monitor](/docs/monitoring-your-api/setting-up-monitor) run. Postman substitutes the values for [variables](/docs/use/send-requests/variables/variables/) in requests or scripts in the monitored collection. By uploading a data file, you can run the collection multiple times with different data in a single monitor run.

## Prepare your collection

Add [variables](/docs/use/send-requests/variables/variables/) to the requests in your collection. Variable names should match the fields in your data file. For example, if your file has a `userId` field, reference it as `{{userId}}` in a request URL. You can also access these values in pre-request and post-response scripts using `pm.iterationData` to access and manipulate variables. Learn more about [using variables](/docs/use/send-requests/variables/use-variables) and [referencing variables in Postman scripts](/docs/tests-and-scripts/write-scripts/postman-sandbox-reference/pm-variables/#pmiterationdata).

## Upload a data file

To upload a data file when configuring a monitor, do the following:

1. [Create or edit a monitor](/docs/monitoring-your-api/setting-up-monitor/#configure-a-monitor).
2. Under **Iteration data**, click the dropdown list and select <img alt="Upload icon" src="https://assets.postman.com/postman-docs/aether-icons/v12/icon-action-upload-stroke.svg#icon" width="20px" /> **Upload a datafile**.
3. Locate and open your CSV or JSON file. Data files are limited to 1 MB and a maximum of 50 data rows (CSV) or 50 objects (JSON). A preview of the file contents appears in the right pane.
4. Complete the remaining monitor configuration and save the monitor.

### Convert a data file to a dataset

After selecting a data file, you can click **Save as dataset** below the preview to convert it to a [dataset](/docs/tests-and-scripts/datasets/overview/). This enables you to query and reuse the data across other Postman workflows.

To convert the data file to a dataset, do the following:

1. Enter a name for the dataset.
2. Enter a name for the view.
3. (Optional) Enter a description for the dataset.
4. Click **Save dataset**.

After saving, the right pane shows a preview of the dataset view. From here, you can do the following:

* Edit the view and click **Run** to preview the results.
* Click **Save** to save your changes to the view.
* Click **Set as new view** to save the changes as a separate view. The monitor automatically switches to the new view.
* Click **Reset** to discard changes and return to the original view.

After converting a data file to a dataset, you can configure the iteration strategy for the monitor run. Learn more at [Use a dataset with a monitor](/docs/monitoring-your-api/test-data/monitors-datasets/).

To learn how to add more data sources or update the view later, see [Manage datasets](/docs/tests-and-scripts/datasets/manage-datasets/).

## Data file format

Data files can be in CSV or JSON format and must use the following structure:

* **CSV** - The first row of the file must contain the variable names and one variable per column. Each following row is considered a data row, with values for each variable. Make sure all rows have the same number of columns and use a UNIX format line ending. Postman iterates through the data rows, running the monitored collection once for each data row in the file.

* **JSON** - The file must be formatted as an array of objects containing the key-value pairs you want to use as variables. For each pair, the key corresponds to a variable name, and the value is used for that variable when running the monitored collection.