---
schema_version: "1"
id: f230d9eba4c4e052ec7e84f0a9a91b18fd6945fca19debe52265374285a0dee0
title: Use CSV Files as Data Sources
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ind/264-0-0/dpe_create_data_source_node_csv_file.md
canonical_url: https://help.salesforce.com/s/articleView?id=ind.dpe_create_data_source_node_csv_file.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: ea97878c385b0698d0f0f8d6ff9ea838bdec6251e0397e29870aae6e5184b4e7
description: In the Data 360 runtime, you can use CSV files to upload large volumes of data to your org. In definitions where the runtime object type is either Data Lake Object or Data Model Object, you can upload CSV files to definitions as data sources. Configure the definition to suit your requirements, and then write back the results to either a data lake object (DLO), a data model object (DMO), or a Salesforce object.
products:
  - Cross Cloud
release: "264"
---
# Use CSV Files as Data Sources

In the Data 360 runtime, you can use CSV files to upload large volumes of data to your org. In definitions where the runtime object type is either Data Lake Object or Data Model Object, you can upload CSV files to definitions as data sources. Configure the definition to suit your requirements, and then write back the results to either a data lake object (DLO), a data model object (DMO), or a Salesforce object.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;"><a href="https://help.salesforce.com/s/articleView?id=ind.dpe_editions.htm&amp;release=264.0.0&amp;type=5" title="Review the supported editions and availability for Data Processing Engine (DPE).">View supported editions</a>.</td></tr></tbody></table>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d15480e65">User Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d15480e65 ">To configure files as data sources:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d15480e65 "><span>
                <a href="https://help.salesforce.com/s/articleView?id=ind.dpe_setup.htm&amp;release=264.0.0&amp;type=5" title="Assign users system permissions, object access, and permission sets that they require to manage, run, and monitor Data Processing Engine (DPE) definitions. User permissions for Data Processing Engine vary based on the runtime platform your company uses to run definitions.">View permissions information.</a>
              </span></td>

          </tr>
        </tbody>
      </table>

## Prepare Data Source Files

Definitions can only process data from CSV files when the files are structured in a particular way. Here's are a few points to consider when preparing CSV files:

- The file must contain a column that acts as the primary key for the rows.
    
    The primary key helps the definition identify each row uniquely and helps you transform the data from the file in nodes like Filter and Group and Aggregate.
- The file must only consist of columns are of data types supported by Data 360.
    
    See [Data Types in Data 360](https://help.salesforce.com/s/articleView?id=data.c360_a_data_types.htm&language=en_US) and [Date and Datetime Formats](https://help.salesforce.com/s/articleView?id=data.c360_a_data_types_and_date_formats.htm&language=en_US).
- The file's size must be up to 75 MB.

Here's the columns and rows of a sample CSV file:

     
| ID | Name | Industry | Size | CreatedDate | LastActivityDate |
| --- | --- | --- | --- | --- | --- |
| 1 | Ursa Major Solar | Renewable Energy | 100 | 2024-05-15 | 2024-08-15T14:30:00Z |
| 2 | Cloud Kicks | Retail | 200 | 2024-05-16 | 2024-09-16T09:15:23Z |
| 3 | Northern Trail Outfitters | Retail | 5,000 | 2024-05-16 | 2024-05-17T18:00:00-05:00 |
| 4 | The Hive Foundation | Non Profit | 50 | 2024-05-18 | 2024-05-20T12:05:45Z |
| 5 | Main Stage Analytics | Consulting | 80 | 2024-12-22 | 2024-12-27T07:22:10-08:00 |

To get definitions up and running quickly, you can create OpenAPI specification-based YAML files with the metadata of the CSV files that you want to use as data sources. The YAML files help the definition understand the structure of the CSV files. The YAML files consist of the metadata and the CSV files contain the actual data that must be transformed. Here are a few points to consider when preparing the YAML file:

- The column names that you specify in the YAML file must exactly match the names of the columns in the CSV file that the YAML is for.
- The YAML must be structured in the following format:<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
              <colgroup>
                <col style="width:50%">
                <col style="width:50%">
              </colgroup>
              <thead class="slds-text-title_caps ">
                <tr class="">
                  <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d15480e326">Format</th>
                  <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d15480e329">Sample</th>
                </tr>
              </thead>
              <tbody>
                <tr class="">
                  <td data-label="Format" class="slds-cell-wrap" style="vertical-align:top;" headers="d15480e326 ">
                    <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code>openapi: 3.0.3
components:
  schemas:
    &lt;name of the schema&gt;:
      type: &lt;schema type&gt;
      properties:
        &lt;name of first column in CSV file&gt;:
          type: &lt;data type of the first column&gt;
        &lt;name of second column in CSV file&gt;:
          type: &lt;data type of the second column&gt;
        &lt;name of third column in CSV file&gt;:
          type: &lt;data type of the third column&gt;
        &lt;name of fourth column in CSV file&gt;:
          type: &lt;data type of the fourth column&gt;
        &lt;name of fifth column in CSV file&gt;:
          type: &lt;data type of the fifth column&gt;</code></pre>
                  </td>

                  <td data-label="Sample" class="slds-cell-wrap" style="vertical-align:top;" headers="d15480e329 ">
                    <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code>openapi: 3.0.3
components:
  schemas:
    Account:
      type: object
      properties:
        AccountID:
          type: integer
        AccountName:
          type: string
        Industry:
          type: string
        AnnualRevenue:
          type: integer
        CreatedDate:
          type: string
          format: date
        LastModifiedDate:
          type: string
          format: date-time</code></pre>
                  </td>

                </tr>
              </tbody>
            </table>

The YAML file is optional. While configuring a data source node, you can manually add the fields from the CSV file schema.

## Decide Your Definition's Data Source Design

The way you configure a data source node to use CSV files as data source can differ based on the purpose of the definition. Here are the different ways in which you can configure data source nodes to accept CSV files based on your requirements:

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
          <colgroup>
            <col style="width:50%">
            <col style="width:50%">
          </colgroup>
          <thead class="slds-text-title_caps ">
            <tr class="">
              <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d15480e381">Requirements</th>
              <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d15480e384">How to Configure the Data Source Node</th>
            </tr>
          </thead>
          <tbody>
            <tr class="">
              <td data-label="Requirements" class="slds-cell-wrap" style="vertical-align:top;" headers="d15480e381 ">The definition requires data from multiple CSV files.</td>

              <td data-label="How to Configure the Data Source Node" class="slds-cell-wrap" style="vertical-align:top;" headers="d15480e384 ">
                <p>Create a data source node for each CSV file that you want to use as data
                  source.</p>
                <p style="margin-bottom:0;">A definition can consist of up to five data source nodes that use CSV files
                  as source.</p>
              </td>

            </tr>
            <tr class="">
              <td data-label="Requirements" class="slds-cell-wrap" style="vertical-align:top;" headers="d15480e381 ">The definition must only be run one time to transform data from CSV files and write
                back the results.</td>

              <td data-label="How to Configure the Data Source Node" class="slds-cell-wrap" style="vertical-align:top;" headers="d15480e384 ">In the data source nodes that use CSV files as data sources, specify the IDs of the
                content documents that contain the CSV files that the nodes must use as data
                sources.</td>

            </tr>
            <tr class="">
              <td data-label="Requirements" class="slds-cell-wrap" style="vertical-align:top;" headers="d15480e381 ">The definition must be run multiple times over time with data from different CSV
                files.</td>

              <td data-label="How to Configure the Data Source Node" class="slds-cell-wrap" style="vertical-align:top;" headers="d15480e384 ">
                <p>In the data source nodes that use CSV files as data sources, use <a href="https://help.salesforce.com/s/articleView?id=ind.dpe_define_input_variables.htm&amp;release=264.0.0&amp;type=5" title="Define flexible data processing rules by using input variables to define default values, filter records, and create formulas. To dynamically control the data filters and formulas at run time, create variables without values and use them to configure Filter and Formula nodes. During a definition run, specify variable values based on your specific requirements. For example, to filter opportunities above a certain value for different fiscal years, set a default value for the input variable and then update it when you run the definition.">File Identifier type input
                    variables</a> to specify the ID of the content documents that contain the
                  CSV files that the nodes must use as data sources.</p>
                <p style="margin-bottom:0;">When the definition is run, you can specify
                  content document IDs that must be used as data sources as input variable
                  values.</p>
              </td>

            </tr>
          </tbody>
        </table>

## Upload CSV Files in Salesforce

Definitions only use CSV files that are [uploaded as content documents in Salesforce Files](https://help.salesforce.com/s/articleView?id=experience.collab_files_uploading.htm&language=en_US). If you want to create a definition that must be run one time, upload the definition's data source CSV file in Salesforce Files, and then create your definition. If you want to run a definition multiple times, then set up a process to upload the CSV files that are used as data sources for each run before starting the run.

## Create a Data Source Node with for a CSV File

1. On the Configuration tab of a Data Source node, select **CSV File**, and then click **Define CSV Schema**.
2. Define the schema of your CSV file in either of these ways:
    
    1. If you've created a YAML file to represent the metadata of the CSV file, upload the YAML file.
    2. If you haven't create a YAML file, manually add fields that represent the CSV file columns, and add the data type and alias for each field.
    
    For both these methods, make sure that the field names are an exact match of the column headers in the CSV file.
3. Save your file schema.
4. For the Primary Key field, select the CSV file column that uniquely identifies each row of the file.
5. For Content Management File ID, either: <table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
            <tbody><tr class="">
              <th style="vertical-align:top;" headers="d15480e514-option" id="d15480e518">Input Variable</th>

              <td style="vertical-align:top;" headers="d15480e514-desc d15480e518">Select the File Identifier type input variable that will provide the content
                document ID of the CSV file.</td>

            </tr>
            <tr class="">
              <th style="vertical-align:top;" headers="d15480e514-option" id="d15480e527">Value</th>

              <td style="vertical-align:top;" headers="d15480e514-desc d15480e527">Enter the ID of the content document that contains the CSV file to use as data
                source.<p>The ID of content documents are available on the URL of the File records
                  that represent content documents. In the URL, the 18 digit alphanumeric that starts
                  with 069 is the document ID. To learn about how to view the details of a file, see
                  View and Edit File Details in Lightning Experience in <a href="https://help.salesforce.com/s/articleView?id=experience.collab_files_previewing.htm&amp;language=en_US" target="_blank">Preview Files and Edit File
                    Details</a>.</p>
              </td>

            </tr>
          </tbody></table>
6. Save the node.

### Join Data from Different Sources

A definition can consist of different data sources such as CSV files, or Data 360 objects, and Salesforce objects. After you add all data source nodes that are required in a definition, use the Join nodes to combine related data from different sources. For example, if a CSV file-based data source has additional details for accounts and another Salesforce object-based data source node brings data from the Account object, you can use the primary key from the CSV file and the ID from the Account object to join the data.

#### See Also

- [Prepare CSV Files](https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/datafiles_prepare_csv.htm)