# Working with CoA Inspections (QMS)

<a href="/en/gr/78610/">QualityOne Vaults</a>
 provide you with the ability to create sample records and analyze samples against inspection plans. As a user processing CoA (Certificate of Analysis) <a href="/en/gr/62019/">inspections</a>
, you can create or select an appropriate _COA Inspection_ record, attach the corresponding CoA file, and then trigger Vault to analyze the CoA file. Ensure that you have uploaded a [CoA file in a supported language][2].

Depending on your <a href="/en/gr/63414/">Admin's setup</a>
, object, field, and section labels may appear differently than the labels mentioned in this article.

<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 currently available only to Early Adopters. Contact your Veeva Representative for more details.</p>
    </div>
  </div>
</div>



## About CoA File Ingestion {#about-ingestion}

After [uploading a CoA file][9], triggering the _Analyze COA_ action scans the CoA file to extract relevant data in a process called "file ingestion". After ingesting the file, Vault compares the extracted data to a specified inspection plan. Vault [uploads the files][1] to the _COA Inspection_ record, any subsequent duplicate records of the initial _COA Inspection_ record for each file, and analyzes the files. Vault then indicates whether the _COA Inspection_ passes or fails based on the inspection plan specifications, and provides you with the inspection sample test results so you can review the results and make any manual adjustments, if needed. Alternatively, an approved <a href="/en/gr/76843/">external user</a>
 (such as a supplier) can email the relevant CoA files to an Admin-specified email address configured in Vault to start the file analysis process.

### About Manual CoA File Uploads {#manual-upload}

When you manually upload a CoA file to a _COA Inspection_ record, Vault automatically does the following:

* Populates the _Type_ and _Subtype_ fields for the <a href="/en/gr/9753/">document</a>

* Links the document to the _Inspection_ record

If _Supplier Name_ and _Supplier Manufacturing Site Name_ fields are empty in the _Inspection_ record, triggering Vault to analyze the CoA file will populate the two (2) fields for the _Inspection_ record with field values from the document; populated fields will not be overwritten by values from the document. If configured, you may also upload or email multi-batch CoA files for analysis for the main _COA Inspection_ batch record. After Vault verifies the number of batches in a file, Vault creates the related _COA Inspection_ batch records for each verified batch and links them to the main _COA Inspection_ batch record.

### CoA Multilingual Limitations {#coa-multi-limit}

The following limitations apply to CoA multilingual support in Vault:

* Currently, we recommend only CoA files in English, Spanish, Italian, Portuguese, French, and German for analysis. Any other language may not be properly analyzed.
* After Vault successfully analyzes the CoA file and creates the appropriate records, your Admin needs to create the localized data to display the localizations in your Vault's locale. See the list of <a href="/en/gr/16678/">Vault-supported languages</a>
 that CoA values can be translated into.
* The following fields are currently supported for localization for the _Inspection Plan Requirement_ object:
  * _Characteristics_
  * _Units_
* CoA files comprising more than one (1) language are currently not supported.

## CoA Sample File Limits {#sample-file-limits}

The following conventions for CoA sample files are supported:

* PDF, JPEG, JPG, and PNG file types
* Maximum file size of 10 MB
* Maximum of 20 pages per file unless modified by your Admin
* Only one (1) file upload per _COA Inspection_ record
* For email intake, a minimum of one (1) to a maximum of 20 CoA file uploads per _COA Inspection_ record
  * Maximum of 10 (ten) batches per multi-batch CoA file.

## Overview {#overview}

The general process of working with a CoA file involves the following steps:

1. [Creating a _COA Inspection_ record][4]
2. [Analyzing a CoA file][6] attached to a _COA Inspection_ record or [emailed to Vault][1]
3. [Reviewing the CoA file test results][7] in the _Inspection Sample Test Result_ section
4. Optional: [Syncing _COA Inspection_ field values to _Inspection Sample Test Results_][13]
5. Optional: [Deleting a _COA Inspection_ record][5]

_Inspection Plans_ and the specification rules for measurement values are <a href="/en/gr/63414/">set up</a>
 by your organization's Admin.

## How to Create a CoA Inspection {#create-coa}

To create a _COA Inspection_:

1. Navigate to _Inspections_ and click **Create**.
2. Select an **Inspection Plan**.
   * If configured by your Admin, if this field is blank when users run the _Analyze COA_ action, Vault attempts to find the relevant _Inspection Plan_ based on information in the CoA file and populates it on the _Inspection_. If Vault cannot find a relevant _Inspection Plan_, CoA file ingestion fails.
3. Optional: Select a **Purchase Order**.
4. Optional: Select a **Purchase Order Line Item**.
5. Do one (1) of the following:
  * If you have a file ready for upload, click **Upload**, select the appropriate file, and click **Open**. 
  * If you do not have the file ready at this time, you or another user can upload the file after record creation.
  * If an external user has the file ready for upload, they can [upload][1] the file after record creation through a workflow task.
6. Optional: Select a **COA Document Language**. If this field is blank, Vault attempts to perform a language detection to set the CoA file's language for the _COA Inspection_ record.
7. Click **Save**, or to create another CoA, click **Save + Create**.

## How to Upload CoA Files by Email Intake {#email-intake}

There are two (2) ways to upload CoA files by email intake:

* **[Vault Interaction with Email Intake][3]**: You and _External Collaborators_ can interact with email intake by receiving an email from Vault for an assigned task to submit CoA files. After receiving the email notification, reply to that email with the appropriate files attached. After Vault receives the email with the appropriate files attached, Vault validates each file and ingests the data.
* **[External Interaction with Email Intake][8]**: You can interact with email intake by compiling CoA file attachments from external parties (such as suppliers) and forwarding the attachments by email to an Admin-specified Vault inbound email address with CoA files for submission attached, unprompted by Vault. After Vault receives the email with the appropriate files attached, Vault validates each file and ingests the data.

### Vault Interaction with Email Intake {#vault-intake}

If you need to upload single or multi-batch CoA files to an existing _COA Inspection_ record without an attached CoA file, you can upload the CoA file by replying to a Vault email notification. The external user assigned on the record as the <a href="/en/gr/76843/">_External Collaborator_</a>
 can upload the CoA file by replying to a workflow task email actioned by you or by an Admin-configured entry action. Depending on your Admin's configuration, uploading a CoA file by email successfully may trigger Vault to [analyze][6] the CoA file as part of a configured entry action. 

To email the CoA files by reply, follow the instructions in the workflow task email and attach the CoA files. When replying, ensure that the subject line contains the number sign followed by a set of parentheses surrounding the _COA Inspection_ record ID. For example, if the _COA Inspection_ record ID is "INSP-000001", then your subject line should contain `#(INSP-000001)`. You may see the _Purchase Order_ and _Purchase Order Line Item_ names after the _COA Inspection_ record ID in the subject line as well.

When you upload multiple valid files, Vault attaches the first CoA file to the initial _COA Inspection_ record (as defined in the subject line of the email) and creates a copy of the initial _COA Inspection_ record, as the source, for each subsequent file uploaded by triggering Vault to run the _Copy Record_ action - each file attached to each newly-copied record (<a href="/en/gr/32218/#how-to-copy-records">a shallow copy</a>
). Depending on your Admin's configuration, uploading CoA files (in the PNG, JPG, or JPEG file types) by email successfully may trigger Vault to [analyze][6] each CoA file as part of a configured entry action for the initial and subsequent records.

<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>: CoA file upload fails if another Vault user or <em>External Collaborator</em> has already successfully submitted a CoA file for the specified <em>COA Inspection</em>.</p>
    </div>
  </div>
</div>



### External Interaction with Email Intake {#external-intake}

You can create _COA Inspection_ records based on the CoA file attachments compiled from external parties (such as suppliers or parties on behalf of suppliers) by emailing the valid single or multi-batch CoA file attachments for validation and data ingestion without needing a Vault login to contribute. You must work with your Admin to ensure that you're emailing to an appropriate Vault email address. Depending on your Admin's configuration, uploading a CoA file by email successfully may trigger Vault to [analyze][6] the CoA file as part of a configured entry action for a lifecycle state.

To email the CoA files, ensure you do the following:

* Set the appropriate Vault email address provided by your Admin in the "To" field.
* Optionally, ensure that the subject line contains a single _Purchase Order_ number. This allows Vault to locate the associated _Inspection Plan_, _Material_, and _Purchase Order Line Item_ records. If you do not include the _Purchase Order_ number, Vault cannot automatically analyze the CoA file after validation and ingestion complete if your Admin has configured an entry action.
* Attach the files according to the [CoA file limitations][10]. Vault expects that all files included share the same _Supplier Name_, _Supplier Manufacturing Site Name_, and _Material_.
* Optionally, you can include specific fields to populate with record details by using JSON formatting in the body of the email. Ensure that when you define the object names to use, enclose the JSON code with curly brackets. For example:

<pre style="color:darkred;background-color:#f0f0f0">
{
  "facility__v": "ABA000000000101",
  "supplier_name__v": "ABB000000000101",
  "supplier_manufacturing_site_name__v": "ABC000000000101",
}
</pre>

Once Vault receives your email with attachments, Vault validates each attachment and ingests the data based on the custom Vault Java SDK implementation. After ingestion, Vault <a href="/en/gr/562/#classification">classifies</a>
 the files as documents and creates a _COA Inspection_ record for each document with all the associated data records linked to the new records and relevant field values populated.

## How to Analyze a CoA File {#how_to_analyze_a_coa}

To analyze a CoA file manually, navigate to the appropriate _COA Inspection_ record and select **Analyze COA** from the **Workflow Actions** menu. If any _Inspection Sample_ records are related to the _COA Inspection_ record, running the _Analyze COA_ action deletes all existing related _Inspection Sample_ records and re-creates new _Inspection Sample_ records according to any new changes since the last time the action ran.

If you don't see the **Analyze COA** option on the **Workflow Actions** menu, the action may be part of an entry action. If available, select **Change State** to change the CoA record's state and trigger the entry action. Depending on your Admin's configuration, you may see the [analysis result][7] as part of an entry action after a CoA file has been [uploaded by email][1].

If you're triggering the _Analyze COA_ action for a multi-batch CoA file on a _COA Inspection_ record, Vault does the following:

* Verifies the number of batches found in the file. The first batch detected is set to the _COA Inspection_ record where the action is triggered; Vault marks this initial record as the _Main Batch_ record.
* Creates the related _COA Inspection_ batch records for each verified batch found after the first.
* Links each related batch record to the _Main Batch_ record where the action was triggered.
* Analyzes each batch record according to the portion extracted from the multi-batch CoA file and creates the _Inspection Sample_ for each batch record (main and related).
  * If you trigger the _Analyze COA_ action again, Vault deletes all existing related _Inspection Sample_ records and re-creates new _Inspection Sample_ records according to any new changes.
* Changes the lifecycle state for the _Main Batch_ record to _COA Uploaded_ and sets all related batch records to the same lifecycle state.

You cannot trigger the _Analyze COA_ action on a related batch record. If you attempt to trigger this action on the related batch record, Vault prompts you to navigate to the _Main Batch_ record to trigger the action from the appropriate record.

## How to Review CoA Test Results {#review-coa}

To review CoA test results:

1. When notified, navigate to the analysis results.
2. Review the values for the **Pass/Fail** and **Pass/Fail Icon** fields.
3. Review the details in the _Inspection Sample Test Results_ section. If configured by your Admin, the _Observed Attribute Result_ field includes any matched text from the CoA file that determines the verdict of each attribute _Inspection Sample Test Result_.
4. Optional: If needed, modify the original or localized data values. Changing the original data values results in the localized data values to mirror the change; the reverse applies as well.
5. If needed, modify values in the **Test Result** column. Modifying test result values triggers Vault to validate the newly-entered data against the specifications. Modifying these values also changes the **Analysis Source** value from _Automatic_ to _Manual_ to reflect the adjustment. Depending on your Admin's configuration, you may see more than one (1) _Test Result_ column.
6. If you made manual changes to the test results, run the **Analyze Inspection** action. You may run the [**Analyze COA**][6] action instead if you need to re-create all related _COA Inspection_ records and their _Inspection Samples_ (previous related records will be deleted in this process).

## Syncing CoA Inspection Field Values {#sync-coa}

When you modify specific fields in a _COA_ type of _Inspection_ record, upon saving, Vault asynchronously updates the related _Inspection Sample Test Result_ record with the new field values, ensuring that your related record has the most up-to-date information. If the asynchronous action fails, you'll receive a Vault notification informing you that the related records weren't synced successfully.

In the event that you receive an error notification, use the _Sync Related Record_ action to manually update related records with the new modified values from the _Inspection_ type record. You'll only need to use this action should an error occur with the asynchronous action. To sync _COA_ type of _Inspection_ field values to its related record's fields manually:

1. Navigate to the appropriate _COA Inspection_.
2. From the **All Actions** menu, select **Sync Related Record**.

If the sync failure persists and you continue to receive error notifications from the job and action, contact your Admin for assistance with the job reference ID provided in the error notification.

## How to Delete a CoA Inspection {#delete-coa}

To delete a _COA Inspection_:

1. Navigate to the appropriate _COA Inspection_.
2. From the **All Actions** menu, select **Delete Inspection**.

[1]: #email-intake
[2]: #coa-multi-limit
[3]: #vault-intake
[4]: #create-coa
[5]: #delete-coa
[6]: #how_to_analyze_a_coa
[7]: #review-coa
[8]: #external-intake
[9]: #manual-upload
[10]: #sample-file-limits
[13]: #sync-coa