---
schema_version: "1"
id: 4e49fa7ea5a1123a28d804c306bf09320533e1d0281bcdca538c45762c2e49dd
title: Create Datasets Programmatically from CSV Files Using the External Data API
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/analytics/264-0-0/bi_integrate_upload_csv_external_data_api.md
canonical_url: https://help.salesforce.com/s/articleView?id=analytics.bi_integrate_upload_csv_external_data_api.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 4c55477ad2412877817aa2ca3aa2b6fc1147cf5a0365fdc17fe4632b149ca5b7
description: You can use the External Data API to create a single dataset based on external data in a .csv file. You can also use the API to edit the dataset by uploading a new .csv file. When you edit the dataset, you can choose to overwrite all records, append records, update records, or delete records.
products:
  - CRM Analytics
  - Cross Cloud
release: "264"
---
# Create Datasets Programmatically from CSV Files Using the External Data API

You can use the External Data API to create a single dataset based on external data in a .csv file. You can also use the API to edit the dataset by uploading a new .csv file. When you edit the dataset, you can choose to overwrite all records, append records, update records, or delete records.

When you upload a .csv file with the External Data API, you have to explicitly set the metadata attributes for each column in the .csv file. For example, you can set the field type and default value for each column. You set the metadata attributes for a .csv file in its own metadata file. A _metadata file_ is a JSON file that describes the structure of an external data file. If no metadata file is provided when you upload external data using the API, CRM Analytics treats every column as a dimension and sets the field type to 'Text.' The field type determines the types of queries that can be placed on the column. For example, you can’t perform mathematical calculations on dataset columns with a Text field type. You can perform mathematical calculations only on dataset columns with a Numeric field type.

For more information about the External Data API, see the [Analytics External Data API Developer Guide](https://developer.salesforce.com/docs/analytics/bi-dev-guide-ext-data/guide/bi-ext-data-overview.html) .