Datasets within CRM Analytics can be accessed, created, and modified using the InsightsExternalData object.
The InsightsExternalData object configures and controls external data uploads. It is used together with the InsightsExternalDataPart object, which holds the parts of the data to be uploaded.
This article uses Workbench to demonstrate creating a CRM Analytics dataset from a CSV file using the External Data API.
Pre-Requisites:
Note: Example files are attached to this article in .zip format (InsightsExample.zip).
The process of creating a CRM Analytics dataset via the External Data API involves three phases:
Step 1 — Log in to Workbench
Navigate to Workbench and log in with your Salesforce credentials.
Step 2 — Create the InsightsExternalData record
Go to Data > Insert > and select InsightsExternalData as the object type. Populate the following fields:
| Field Name | Example Value | Description |
| Dataflow | DataflowName | The name of the associated dataflow |
| Description | Description | A human-readable description of the dataset |
| EdgemartAlias | MyExternalDataset | The API name (alias) for the dataset in CRM Analytics |
| EdgemartLabel | MyExternalDataset | The display label for the dataset |
| FileName | InsightsDataset | The name of the external data file being uploaded |
| Format | Csv | The format of the external data file |
| MetadataJson | [Base64-encoded metadata JSON string] | The Base64-encoded content of your metadata JSON schema file |
| Operation | Upsert | The data operation — valid values include Upsert, Append, Delete, Overwrite |
Step 3 — Store the InsightsExternalData record ID
After inserting the record, save the Salesforce ID that is generated. You will need this ID in the next step.
Step 4 — Insert InsightsExternalDataPart records
For each data file chunk, insert an InsightsExternalDataPart record with the following fields:
| Field Name | Example Value | Description |
| DataFile | [Base64-encoded data file string] | The Base64-encoded content of the data chunk |
| DataLength | [Leave blank or populate if known] | The length of the data |
| InsightsExternalDataId | [ID from Step 3] | The ID of the parent InsightsExternalData record |
| PartNumber | 1 | The sequence number for this chunk (start at 1) |
For large files, split the data into 10 MB chunks and insert a separate InsightsExternalDataPart record for each chunk, incrementing PartNumber for each.
Step 5 — Trigger processing
Go to Data > Update > InsightsExternalData. Use the record ID from Step 3. Set the Action field to Process and click Update.
Step 6 — Verify the dataset
Navigate to Analytics Studio > Data Manager. A job with the name of the dataset alias will appear. Once the job completes successfully, the dataset is created and available in CRM Analytics.
You can also use other operation types on the InsightsExternalData object such as Append, Delete, and Overwrite to modify existing datasets.
External Data API Developer Guide
External Data API Limits
InsightsExternalData Object Reference
External Data Metadata Format Reference
Workbench
000384582

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.