Before you attach a data file anywhere, your collection has to speak the same language as the file: variable names in the request must match column headers, and your tests should read row values with pm.iterationData. This part builds that foundation in a dedicated workspace.
Create your Data Files workspace
Everything in this module — collection, environment, and monitor — lives in one workspace so your iteration data stays easy to find.
-
Open the Postman desktop app. If you don't have it yet, download Postman and sign in — if you're already signed in, you're good to go.
-
Click Workspaces in the top navigation → Create.
-
On the Create your workspace form, in Workspace name enter [Your name] - Data Files (e.g. Alex - Data Files).
text- Data Files -
For Who can access, open the dropdown and choose Only you and invited people — Internal is already selected.
-
Leave the template on Blank workspace (already selected), then click Create Workspace.
Your new workspace opens automatically. You should see an empty sidebar with no collections yet.
Troubleshooting: If validation fails, check that your workspace name ends with - Data Files (with the hyphen) and that you created it yourself rather than joining someone else's.
Build the parameterized Movies API collection
A data file replaces hard-coded values on every iteration. You'll create one GET request whose URL uses {{movieId}} and a post-response test that reads {{expectedTitle}} from the current row via pm.iterationData.
Create the collection
-
Confirm you're in your Data Files workspace (check the name in the top-left).
-
In the left sidebar, click + → Collection.
-
Name it:
textMovies API — Data Driven
Add the request
- Select Movies API — Data Driven, click ⋯ → Add request (or Add request under the collection if it's expanded).
- Name the request Get Animation Movie by ID, leave the method as GET, and paste this URL:
{{baseUrl}}/movies/animation/{{movieId}}- Open the Scripts tab, select After response, and add:
pm.test("Status code is 200", function () {
pm.response.to.have.status(200);
});
pm.test("Title matches iteration data", function () {
const expected = pm.iterationData.get("expectedTitle");
pm.expect(pm.response.json().title).to.eql(expected);
});- Save the request.
Your data file (save this for the next parts)
Create a file named movies.csv with exactly these rows — the header row names must match your variables (case-sensitive):
movieId,expectedTitle
1,The Lion King
5,Zootopia
9,Finding NemoAlternative format (JSON)
The same three rows as a JSON array — useful when your tooling exports JSON more easily than CSV:
[
{ "movieId": "1", "expectedTitle": "The Lion King" },
{ "movieId": "5", "expectedTitle": "Zootopia" },
{ "movieId": "9", "expectedTitle": "Finding Nemo" }
]Expected outcome: One request in the collection with {{movieId}} in the URL and two tests on the After response script. The request won't send successfully yet — {{baseUrl}} is unresolved until the next step.
Add the Data Files environment
Monitors run in the Postman cloud, so values your collection depends on must be available there. Putting baseUrl in an environment — with a shared value — lets the same collection run locally and in the cloud.
-
In the left sidebar, click + next to Environments to create a new environment.
-
Name it:
textData Files -
Add a variable named
baseUrl. If you don't see a Shared Value column, click the ⋯ menu at the far right of the variables table header, then under Show as column, check Shared Value. -
In the Value and Shared Value columns, enter:
https://api.sampleapis.com- Click Save.
- Select Data Files from the environment selector in the top right and open Get Animation Movie by ID.
- Hover over
{{movieId}}in the request URL and set its value to1for this send — Postman resolves the variable at runtime so the request hits/movies/animation/1. - Click Send and confirm you get
200 OKwith a JSON body whose"title"is"The Lion King".
Expected at this stage: The Status code is 200 test should pass. The Title matches iteration data test will fail — that's normal. You're not using a data file yet, so pm.iterationData.get("expectedTitle") is undefined and Postman's test results will show Title matches iteration data failing with an AssertionError that 'The Lion King' does not equal undefined.
That assertion starts passing in Part 2 once you run the collection with movies.csv attached.
baseUrl in both the Value and Shared Value columns. Value resolves {{baseUrl}} when you send requests locally or run the Collection Runner; Shared Value is what monitors and LiftOff read from the cloud.