# Correcting Leaf Source File Paths

Quite frequently, your organization may need to update the _Application Folder Name_ of a given application. For example, to align your Vault with updated FDA naming guidances, or for data migrations. When the application is related to a previously-imported submission, the _Application_ update must also be propagated to the _Submission Metadata_ records of the imported submissions to maintain data integrity.



<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>: This feature is available in RIM Submissions Archive only and must be performed by a user with a <em>Vault Owner</em> or <em>System Admin</em> security profile.</p>
    </div>
  </div>
</div>



## About Leaf Source File Path Correction

The _Leaf source file path correction_ Admin setting provides a way to automatically and safely apply the updates after the _Application Folder Name_ has been updated, as it is only available in Configuration Mode.

Vault may detect exceptions to the correction operation, and skip updating certain applications, submissions, and leafs.

### Application Exceptions {#application-exceptions}

Vault does not perform the correction operation when:
  * The _Application_ record has an invalid _Dossier Format_ field, where the referenced _Controlled Vocabulary_ record is missing the application folder name token in its _Parameter_ field.
  * At least one submission within the application meets any of the criteria listed in [Submission Exceptions][2].
  * The _Application Folder Name_ includes a backslash (`\`) or forward slash (`/`).

### Submission Exceptions {#submission-exceptions}

Vault does not perform the correction operation on _Submissions_ where:
  * The _Submissions Archive Status_ is any status other than the accepted _Import Succeeded_ and _Import Successful_ statuses for imported submissions.
  * The _Dossier Status_ is any status other than the below accepted statuses for published submissions:
    * _Publishing Inactive_
    * _Merge In Progress_
    * _Transmission In Queue_
    * _Transmission In Progress_
    * _Transmission Successful_
    * _Transmission Failed_

### Leaf Exceptions {#leaf-exceptions}

Vault does not update leafs referenced [across applications](/en/lr/486082/#across-submissions-and-applications).

Additionally, Vault does not update leafs when there is a duplicate folder name within the source file path, for example `{application__v.folder_name__v}/{submission__v.xml_submission_id__v}/{application__v.folder_name__v}/{submission__v.xml_submission_id__v}`

### Email Preferences

Configuring the following Notification Templates to _Email Preference: Every Occurrence_ ensures pertinent information is delivered via Vault Notification Emails:

* _SA Source File Path Update Results_ (`sa_source_file_path_update_results__v`)

## How to Correct Leaf Source File Paths

1. Review the _Dossier Format_ field within each of the _Application_ records you plan to correct. For each _Controlled Vocabulary_ record referenced as the _Dossier Format_, ensure the _Parameter_ field includes a token for the application folder name, for example `{application__v.folder_name__v}/{submission__v.xml_submission_id__v}`. Vault uses these fields to determine which records to update during the operation.
2. Navigate to **Admin > Operations > Job Status** and verify that the **Submissions Archive Harmonization** job is not **Running**. If it is running, wait for the job to complete and appear in the **History** panel.
3. Navigate to **Admin > Operations > Job Definitions** and set the **Submissions Archive Harmonization** job's *Status* to *Inactive*.
4. Enable [Configuration Mode](/en/lr/36928/) in your Vault.
5. Navigate to **Admin > Settings > Application Settings**.
6. Under **Submissions Archive**, select **Leaf source file path correction**, then select up to 12 **Applications** to update during the operation.
7. Click **Save**.

Vault begins processing your request. When complete, Vault:
  * Sends you an email and notification with a CSV file detailing the results.
  * Resumes the `SubmissionImportFastQueue` and `SubmissionImportQueue` it paused during the operation.
  * Clears the _Leaf source file path correction_ checkbox and selected _Applications_ so that you can repeat the operation, if needed.

Once you've completed all leaf source corrections, disable Configuration Mode and re-activate the Submissions Archive Harmonization job by setting its _Status_ to _Active_.

[1]: #application-exceptions
[2]: #submission-exceptions
[3]: #leaf-exceptions
