**Source URL:** https://clinical.veevavault.help/en/lr/46280/index.md

# Creating & Updating Records With Vault File Staging

You can use Vault file staging to load object data into your Vault. You can create and update records for a single object with a single CSV file, or use a ZIP file containing multiple CSVs to create and update records for multiple objects at once. Updating objects maintains all relationships and references to the object, such as the audit trail.

In Vault, the update operation is distinct from a delete and create operation. Instead of deleting the existing record, and then replacing it with a new record containing updated data, Vault simply updates the existing object record.

## Accessing Your Vault's File Staging

See [Accessing your Vault's File Staging](/en/lr/38653/) for instructions. Once you've connected to your Vault's file staging, you can enable this feature and begin loading data.

### How to Enable File Staging Automation

To enable this feature, you must create a new directory on file staging named "Vaultloader" in each user's directory. For example, to create the "Vaultloader" directory for Clara, a Vault user whose _User ID_ is _5678_, navigate to vault1234/u5678 and add "/vaultloader". Load CSVs and ZIP files into this directory.

## Preparing the CSV Input

The format for your CSV input is much the same as it is for Vault Loader. Label columns with the field's _Name_ value (field\_name\_\_v), and enter field values as one object record per row. The list below details requirements for your CSVs:

  * Create one CSV file per object.
  * Use the object field's _Name_ value (field\_name\_\_v, \_\_c, __clin) as the column header.
  * Name your CSV file with the object's _Name_ value (object\_name\_\_v, \_\_c, or \_\_clin). For example, to load records into the _Subject_ object, name the CSV "subject__clin.csv".
  * Save as a *.csv file.
  * To transfer multiple CSVs, add each CSV to a ZIP file.

If you are updating existing records, rather than creating new ones, you can ensure that Vault updates the existing records by specifying a unique field (such as _Name_ or _ID_) that Vault can use to match each row in your CSV to a record. Use the field as a column in your CSV, and then append the field name to your CSV filename in the following format:

`object_name__v.field_name__v.csv`

For example, if Gladys is loading subject enrollment data from an EDC report into her CTMS Vault, she might use the _External ID_ field on the _Subject_ object to match subject records between her report and her target Vault.

Gladys can include an _External ID_ (`external_id__v`) column in her CSV. Gladys would then save with the filename `subject__clin.external_id__v.csv`.

### Define an Order for Vault to Process CSVs

When you are loading record data to multiple objects, you may need to define an order for Vault to process the CSVs. For example, Gladys is loading record data to both the _Subject_ and _Protocol Deviation_ objects. _Protocol Deviation_ has a reference relationship to _Subject_. Gladys must create the _Subject_ records before she can successfully create the _Protocol Violation or Deviation_ records that reference them. She can load both CSVs at the same time in a ZIP file, as long as she includes an order.txt file.

Create a plain text (.txt) file that lists the objects you're loading to in the desired order. For example, Gladys's `order.txt` file would include:

`subject__clin`

`pdv__clin`

Vault ignores any rows that do not reference an an object name in one of the CSV file names. So, you can reuse the same order.txt file for multiple data loads, even if you do not load the complete combination of objects each time.

If you don't include an order.txt file in your ZIP file, Vault processes the CSVs in alphabetical order.

### Sample CSVs

  * <a class="download-link " href="https://platform.veevavault.help/assets/downloads/clinops-ftp-single-object.csv" target="_blank" rel="noopener">Single object<i class="fa fa-download" aria-hidden="true"></i></a>
  * <a class="download-link " href="https://platform.veevavault.help/assets/downloads/clinops-ftp-multi-object.zip" target="_blank" rel="noopener">Multiple objects<i class="fa fa-download" aria-hidden="true"></i></a>

### File Staging Details

Vault automatically deletes your loader files from file staging after seven (7) days.

## How to Load Data to a Single Object

  1. Connect to file staging.
  2. Load your CSV file into the /vaultloader directory.
  3. Vault ingests the CSV and creates or updates the appropriate object records.

## How to Load Data to Multiple Objects

  1. Connect to file staging.
  2. Load your ZIP file into the /vaultloader directory.
  3. Vault ingests the CSVs in the order specified by your order.txt file, and creates or updates the appropriate object records.

## Success & Failure Log Files

After each load, Vault creates separate success and failure logs as CSV files. You can download these files from the in-Vault notification or email notification. Both files contain the system-managed ID values of each record.

### Failure Logs

Failure logs include:

  * Error messages for each record that failed to load
  * Original data alongside corresponding errors
  * Row IDs from the original CSV file for the corresponding row

You can review and fix errors from within the error log. Once you correct any errors, you can re-import the failure log.

## Related Permissions

You can complete all steps in this article with the standard _System Admin_ or _Vault Owner_ profile.

If your Vault uses custom security profiles, your profile must grant the following permissions:

<table class="wbord">
  <tr>
    <td>
      <strong>Type</strong>
    </td>
    <td>
      <strong>Permission Label</strong>
    </td>
    <td>
      <strong>Controls</strong>
    </td>
  </tr>
  <tr>
    <td>
      Security Profile
    </td>
    <td>
      Admin: File Staging: Access
    </td>
    <td>
      Ability to access your Vault's file staging.
    </td>
  </tr>
  <tr>
    <td>
      Security Profile
    </td>
    <td>
      Admin: Access API
    </td>
    <td>
      Ability to make an API call, which is required to create and update records via file staging.
    </td>
  </tr>
  <tr>
    <td>
      Security Profile
    </td>
    <td>
      Vault Owner Actions: Vault Loader
    </td>
    <td>
      Ability to see and use the <strong>Vault Loader</strong> tab. While creating and updating records via file staging does not use the <strong>Vault Loader</strong> tab, permission to use Vault Loader is required for automating the load with file staging.
    </td>
  </tr>
  <tr>
    <td>
      Security Profile
    </td>
    <td>
      Objects: {Object}: Create, Edit
    </td>
    <td>
      Ability to create and edit records for the object you are loading into Vault.
    </td>
  </tr>
  <tr>
    <td>
      Security Profile
    </td>
    <td>
      Objects: {Object}: Read
    </td>
    <td>
      Ability to view records related to the object you are loading into Vault. For example, when creating <em>Subjects</em>, users need <em>Read</em> access to the  <em>Study</em>, <em>Study Country</em>, and <em>Site</em> objects.
    </td>
  </tr>
</table>
