Manage datasets in Postman
Datasets are available on Postman Solo, Team, and Enterprise plans. For more information, see the pricing page.
You can manage your datasets to keep their data sources and views current. As your workflows evolve, you can add new data sources, update existing ones, and modify views to control how data is retrieved and used in your tests, scripts, and mock servers.
Datasets are only supported in Local View on the Postman desktop app.
Manage datasets
You can manage a dataset to update its details or make changes to how it’s stored in your workspace. Each dataset is defined by a YAML file in your local Git repository, which includes its data sources and views.
To manage a dataset, do the following:
- Click
Items in the sidebar.
- Click Datasets.
- Next to a dataset, click
View more actions.
You can perform the following actions:
- Rename — Change the dataset’s name.
- Edit YAML — Open and edit the dataset’s YAML file directly. This file defines the dataset’s data sources and views and is stored in your local Git repository. The file also includes metadata about the dataset, such as its name and ID.
- Delete — Remove the dataset from your workspace.
Manage data sources
You can expand an existing dataset by adding a new data source or updating an existing one. A data source defines where your dataset’s data comes from, such as a local file or an external database connection. You can add multiple data sources to a dataset.
Add a new data source
To add a new data source, do the following:
- Click
Items in the sidebar.
- Click Datasets.
- For a dataset you want to update, click
Add source next to Sources.
- Click Add New Source.
- Click the data source dropdown list, then select a data source type.
- Configure the data source.
- (Optional) Click Add New Source to add more data sources to the dataset. Add multiple data sources to combine different types of data in your workflows.
- Click Save.
You can also click next to a data source to remove it from the dataset. Make sure to update any views that use the existing data source because deleting it will break those views.
Update an existing data source
To update a data source, do the following:
- Click
Items in the sidebar.
- Click Datasets.
- Select a data source to update.
- Update the data source configuration according to the data source type. You can also update the configuration from the Settings tab, depending on the data source type.
- Click Refresh to update the preview with the latest data from the file or database. You can view the preview from the Data tab.
Next to a data source, you can click View more actions to do the following:
- Rename — Change the data source’s name.
- Delete — Remove the data source from the dataset. Make sure to update any views that use this data source because deleting it will break those views.
Update a data source with Agent Mode
You can use Agent Mode to add new data sources or update existing ones with sample data. This is useful when you want to quickly refresh test data or expand a dataset without manually editing files or database records.
For local data sources, Agent Mode can create or update CSV or JSON files with additional or modified data. For example, you could ask Agent Mode the following:
If you have a connected database, you can use Agent Mode to generate and insert sample data into existing tables. For example, you could ask:
After updating the data source, you can refresh the data source and update your views as needed to reflect the changes.
Manage views
You can add a new view or update an existing one to change how data is retrieved from your dataset. A view defines how data is filtered, combined, or transformed for your workflows. For example, you might update a view’s query to return only a subset of data from the data source, or to create new columns based on existing data.
To add or update a view, do the following:
-
Click
Items in the sidebar.
-
Click Datasets.
-
Choose one of the following:
- To add a new view, click
Add view next to Views.
- To update an existing view, select a view.
- To add a new view, click
-
Enter an SQLite-compatible query to define how the data is retrieved from the data source. To learn more about writing queries, see Example dataset views.
-
Click Run to execute the query.
-
In the table pane, you can preview and search the query results.
Next to a view, you can click View more actions to do the following:
- Rename — Change the view’s name.
- Preview — Preview a subset of the data returned by the view’s query.
- Delete — Remove the view from the dataset. This doesn’t delete the underlying data source, but it does remove the view’s query and any transformations it applies to the data.
Troubleshoot datasets
If you encounter issues when working with datasets, use the following troubleshooting steps to identify and resolve common problems.
The error icon (!) may appear next to a dataset in the left sidebar in the following scenarios:
-
Dataset is out of sync — This can happen if you edit dataset files outside of Postman or if there are unresolved merge conflicts. Restart Postman to resync the dataset with your local files.
-
Invalid or corrupted dataset files — This can happen if the dataset files have invalid formatting or content. Check the files in your local Git repository for formatting issues, or restore them from a previous commit if recent changes caused the issue.
If you have any issues with your datasets, contact Postman support.