# Preparing Submissions for Import (RIM)

Before you can [import final submission dossiers](/en/lr/28082/) in RIM Submissions Archive, you need to set your Vault up for imports. You can also define your submission folder hierarchy.

<div class="note-border alert-info">
  <div class="alert alert-info" role="alert">
    <div><i class="far fa-info-circle"></i></div>
    <div class="alert-text">
      <p><strong>Note</strong>: These features are only available on RIM Submissions Archive Vaults.</p>
    </div>
  </div>
</div>



## How to Set Up for Imports in Vault

When setting up a submission import, you must complete the following:

  * Create the corresponding _Application_ and _Submission_ object records.
  * Create _Controlled Vocabulary_ records and set the _Controlled Vocabulary Type_ field to **Dossier Import** for each type of submission you may import.
  * Optional: Define the submission folder hierarchy. See [details about this step][2] below.

## Defining the Submission Folder Hierarchy {#hierarchy}

You can import submissions without needing to stage submission content outside of Vault to achieve a specific display in the Submissions Archive **Viewer** tab. Instead, set the following fields to configure the desired folder hierarchy:

  * On the _Submission_ record, set the **Dossier Format** field. The _Dossier Format_ field is an object reference field to the _Controlled Vocabulary_ object.
  * On the *Submission* record, set the optional **Actual Submission Date** field. This field is required prior to importing eCTD 4.0 submissions. 
  * On _Controlled Vocabulary_ records with the _Controlled Vocabulary Type_ field set to **Dossier Format**, fill in the **Parameter** field.

The _Parameter_ field stores the target path structure for the dossier format. When you import a _Submission_, Vault leverages the data in the _Parameter_ field on the related _Controlled Vocabulary_ record to determine how the folder hierarchy should display in the [**Viewer** tab](/en/lr/450731/), the naming of the Application and Submission folders, cross-document link navigation, and the submission export structure. See [example parameters][4] below.

If you leave these fields blank, Vault imports the submission as usual by leveraging the information contained within the ZIP/TAR.GZ or as staged on file staging.

### Example Parameters {#parameters}

You can configure different parameters for different dossier formats. Download the <a class="download-link " href="https://platform.veevavault.help/assets/downloads/dossier-format-parameters.zip" target="_blank" rel="noopener">Dossier Format Parameters<i class="fa fa-download" aria-hidden="true"></i></a> file to see examples. The _Parameter_ field should only reference fields on the _Application_ and _Submission_ objects.

## How Vault Imports Submissions {#how-vault-imports}

Vault can import submissions with no application or submission folders defined. If you're importing from file staging, Vault still requires you to stage the Application and Submission folders, but you don't need to configure any additional structuring.

### eCTD Submissions

If your submission contains the _Index XML_ at the root within the first or second folder, Vault imports the _Submission_ as an eCTD. If you've defined a _Dossier Format_ and _Parameter_, Vault uses the first two (2) parameter values to define the Application and Submission folders. If you define more than two (2) folder parameters, the import fails.

eCTD submissions display as usual in the **Viewer** tab. When defined, Vault also leverages the _Dossier Format_ and _Parameter_ fields for submission export and cross-document link navigation.

For example, you've set your submission's _Dossier Format_ to **eCTD**, and the _Parameter_ for eCTDs is `{application__v.folder_name__v}/{submission__v.xml_submission_id__v}`. The _Folder Name_ is set to **NDA 123456** and the _XML Submission ID_ is **0000**. Your submission contains the _Index XML_ within a single Submission folder called "0000", as well as a "0000-working-documents" folder at the root.

When you import your submission, the contents of the "0000" folder, including the _Index XML_ and other files, exist within the submission folder path **nda123456/0000**. Vault imports the "0000-working-documents" folder as a non-eCTD/Unreferenced File, with the folder path **nda123456/0000-working-documents**. This folder displays at the same level as the **util** folder in the **Viewer** tab.

### Non-eCTD Submissions

If your _Submission_ contains a file other than the _Index XML_ at the submission root or within the first or second folder, Vault imports the _Submission_ as a non-eCTD.

If you've defined a _Dossier Format_ and _Parameter_, Vault uses the first two (2) folder parameter values to define the Application and Submission folders and any additional parameters to define the section display within the **Viewer** tab. When defined, Vault also leverages the _Dossier Format_ and _Parameter_ fields for submission export and cross-document link navigation for non-eCTD submissions.

For example, you've set your submission's _Dossier Format_ to **Paper (CTD)**, and the associated _Parameter_ is `{application__v.folder_name__v}/{submission__v.xml_submission_id__v} /Paper/{submission__v.name__v}`. The _Folder Name_ is set to **NDA678910** and the _XML Submission ID_ is **2019-01-23 Labeling Update**. Your submission contains a _toc.pdf_ file at the submission root, with no folder structure defined.

The submission's folder path in the **Viewer** tab is **Paper/2019-01-23 Labeling Update**. When you export the submission or navigate links, the folder structure is **nda678910/2019-01-23 Labeling Update**.

#### Folder Hierarchy for Compressed Non-eCTD Submissions

To prepare a non-eCTD import where there is more than one folder in the submission, please place the two or more folders that constitute the submission into a single parent folder before compressing the file into a .zip or .tar.gz.

If a compressed file contains multiple folders at the root level, the Submissions Archive Viewer may not accurately reflect the intended structure and can result in intermediate folders being omitted or "skipped" in the display.

**Example** 

In this example, the submission consists of two main folders: Clinical-Inspection and Quality-System-List. To ensure both appear correctly in the Viewer, they are placed inside a single parent folder named Cholecap before zipping.

 | Structure Level | Local Folder Path |
| :---- | :---- |
| Root (ZIP File) | Cholecap\_Submission.zip |
| Single Parent Folder | /Cholecap/ |
| Submission Folder 1 | /Cholecap/1.Clinical-Inspection/ |
| Submission Folder 2 | /Cholecap/2.Quality-System-List/ |
| Content Document | /Cholecap/1.Clinical-Self-Inspection/report.pdf |


### eSTAR Submissions
If your submission contains at least one PDF that is XFA format, Vault can import it in the eSTAR format. To do this, set your submission's _Dossier Format_ to **eSTAR** prior to import and ensure your Vault has a Controlled Vocabulary record for the eSTAR dossier format with the _Vault RIM UUID_ value set to **f4941703-6ac5-471d-8649-c4f53673353d**.

eSTAR submissions must be 4GB in size or smaller. Submissions with eSTAR Dossier Format that are over the 4GB limit will be imported as a non-eCTD. No file extraction, but the original XFA will be imported.

### Importing Submissions via File Staging {#FTP}

When using your Vault's [file staging](/en/lr/38653/), the root folder should be named "SubmissionsArchive", followed by the Application sub-folder, and then individual Submission sub-folders. Depending on the _Application Folder Name_ and the submission's _XML Submission ID_, or the _Parameters_ and _Dossier Format_ (if defined), Vault can select the right folder by default.

Users with the _File Staging_ permission may also upload and import submissions via a _Submissions Archive Import_ folder within their personal file staging directory in addition to the root _SubmissionsArchive_ folder.

If these folders don't exist within your Vault's file staging, you'll need to create them.

See the API reference documentation on <a class="external-link " href="https://developer.veevavault.com/api/23.3/#import-submission" target="_blank" rel="noopener">importing submissions<i class="fa fa-external-link" aria-hidden="true"></i></a> for more information.

## Submission Import Limitations

The submission files you import are subject to various file size and structure requirements. We recommend reviewing your files against these [limitations](/en/lr/28082/#errors-and-limitations) prior to attempting to import them.

## Related Permissions

You must be assigned a permission set with the below permissions to define the submission folder hierarchy for import:

| Permission Label | Permission | Controls |
|---|---|---|
| Objects: Controlled Vocabulary | Read, Create, Edit | Ability to create _Controlled Vocabulary_ records and define a _Parameter_ on existing records. |
| Objects: Submission | Read, Edit | Ability to select a _Dossier Format_ for a _Submission_ |


 [2]: #hierarchy
 [4]: #parameters
