Source: https://vaultcrmhelp.veeva.com/doc/Content/CRM_topics/SampleManagement/RecordingSampleTransactions/PrintPackageLabels.htm

## Generating Printable Package Labels

To quickly and easily ship products, end users can generate printable package labels directly from sample transfer and return records. To ensure accuracy, product information on the package label is copied from the corresponding Sample Transaction record. Sample admin users can upload customized package label templates to modify which fields display on the package label.

**Who can use this feature?**

* Sample Admin Users — Browser
* [Creating Package Label Templates](#Creating2)
* [Creating Token Mapping Files](#Creating)
* [Uploading and Publishing Package Label Templates](#Uploadin)
* End Users — Browser
* [Generating Printable Package Labels](#Generati)
* Users do not require an additional license

### Configuring Printable Package Labels for

[![Closed](../../../../Skins/Default/Stylesheets/Images/transparent.gif)Sample Admin Users](#)

To configure this feature:

1. Ensure [Configuring Sample Management](../ConfiguringSM.htm) is complete.
2. Navigate to **Admin > Users & Groups > Permission Sets**.
3. Select the appropriate permission set.
4. Select the **Objects** tab.
5. Select **sample\_transaction\_\_v**.
6. Grant Execute permission for the **create\_package\_label\_\_v** (Create Package Label) object action.
7. Ensure sample admin users have **Create Document Permission** for the following Dynamic Word Template document types:

* sample\_transfer\_package\_label\_\_v
* sample\_return\_package\_label\_\_v

See [How to Edit Document Types](https://platform.veevavault.help/en/gr/618/#EditingDocTypes) for more information.

[![Closed](../../../../Skins/Default/Stylesheets/Images/transparent.gif)End Users](#)

To configure this feature:

1. Ensure [Configuring Sample Management](../ConfiguringSM.htm) is complete.
2. Navigate to **Admin > Users & Groups > Permission Sets**.
3. Select the appropriate permission set.
4. Select the **Objects** tab.
5. Select **sample\_transaction\_\_v**.
6. Grant Execute permission for the **create\_package\_label\_\_v** (Create Package Label) object action.
7. Navigate to **Admin > Configuration > Objects > sample\_transaction\_\_v**.
8. Select the **Object Types** tab.
9. Select **Actions**.
10. Select **Edit Object Type Actions** from the All Actions menu.
11. Enable the **create\_package\_label\_\_v** (Create Package Label) action for the transfer\_\_v and return\_\_v object types.
12. Ensure end users are included as **Viewers** in the Default Settings for New Documents for the following Dynamic Word Template document types:

* sample\_transfer\_package\_label\_\_v
* sample\_return\_package\_label\_\_v

See [How to Edit Document Types](https://platform.veevavault.help/en/gr/618/#EditingDocTypes) for more information.

### Creating Package Label Templates as

[![Closed](../../../../Skins/Default/Stylesheets/Images/transparent.gif)Sample Admin Users](#)

Sample admin users can download a [sample transfer package label template](Template/transfer_package_label.zip) and a [sample return package label template](Template/return_package_label.zip), both of which include token mapping files. After making any desired updates according to the guidelines below, sample admins can upload a .zip file with the template and field mappings for use in Vault CRM. The .zip file must contain:

* One .docx file consisting of the package label template. Any formatting used in the .docx file is reproduced in the package label output.
* One .txt or .tsv file defining how merge fields in the .docx file map to tokens in Vault CRM. This file must contain exactly two rows: one row of merge fields and one row of corresponding tokens.

#### Creating the Package Label Template

To create a .docx file for a package label template:

1. Create the template as a **.docx file** in Microsoft Word. For guidelines, see [Formatting Guidelines for Package Label Templates](#Formatti).
2. Use [Mail Merge](https://support.microsoft.com/en-us/office/use-mail-merge-for-bulk-email-letters-labels-and-envelopes-f488ed5b-b849-4c11-9cff-932c49474705) to insert merge fields for tokens in the .docx file. Merge field labels must meet the following requirements:

* Alphanumeric and underscores only (no spaces or special characters)
* No more than 40 characters in length
* Exactly match the merge\_field\_label values in the token mapping file

3. Ensure users have at least Read permission for all fields referenced in the template. If users are not granted permission for a referenced field, the field value does not render on the package label.
4. Save the template.

#### Formatting Guidelines for Package Label Templates

The following are guidelines for character encoding and layouts:

* Character encoding must be UTF-8
* Page size and margins:
* Margins of at least 0.5 inches on all sides are recommended
* Ensure the document renders properly and does not result in clipping, misalignment, or unreadable content
* Layout best practices:
* Use tables to structure content wherever possible. Tables provide consistent layout and spacing during the conversion from .docx to .pdf.
* Avoid using floating text boxes, wrapped images, or embedded objects

The following fonts are recommended, with a font size of 12pt or larger:

* Arial
* Calibri
* Courier New
* Times New Roman

Sample admins may use fonts outside the recommended list if the .docx file embeds the font and the font is fully licensed for Microsoft Word embedding.

Before publishing, Veeva recommends sample admins confirm:

* The embedded font is preserved during document conversion
* All text remains readable in the label output, including small and bold text
* Layout, spacing, and line wrapping are not affected by font substitution

### Creating Token Mapping Files as

[![Closed](../../../../Skins/Default/Stylesheets/Images/transparent.gif)Sample Admin Users](#)

Package label templates rely on a token mapping file to map the merge field labels in the .docx file to corresponding Vault CRM tokens. Merge fields are populated with token values from Vault CRM when the package label document is published.

To create a token mapping file:

1. Create a **tab-delimited text file** (.txt or .tsv) containing two rows to map the merge field labels to corresponding Vault CRM tokens.
2. Enter the **merge field labels** from the .docx file in the first row.
3. Enter the corresponding **CRM token** for each merge field in the second row.
4. Save the file.

#### Formatting Requirements

The following is a list of formatting requirements for token mapping files:

* The file must be a tab-delimited text file (.txt or .tsv)
* The file must include exactly two rows:
* merge\_field\_label - Column headers representing merge fields in the .docx file (for example, Submitted\_Date, Sender\_Address)
* token - Corresponding Vault CRM token values (for example, {{sample\_transaction\_\_v.submitted\_date\_\_v}}, {{senderRepRoster.address\_line\_1\_\_v}}
* Each column maps one merge field in the .docx file to a supported token
* Each merge\_field\_label must exactly match a merge field in the .docx file
* The file must not contain duplicate merge\_field\_label entries
* The file must not contain empty fields
* Merge field labels must not contain spaces or special characters
* The file must include valid tokens

#### Supported Package Label Tokens

Tokens are used to customize the data displayed on package labels, retrieving data from fields on the primary Sample Transaction and its related object records (Rep Roster, Sample Lot, and Product Catalog).

The following field types are supported for package label tokens:

* Text
* Number
* Date
* DateTime
* Yes/No
* Picklist (resolves to the picklist label in the user's language)

The following tokens can be used to customize package labels:

| Token | Description |
| --- | --- |
| {{sample\_transaction\_\_v.FieldAPIName}} | Retrieves a field value from the initiating Sample Transaction (sample\_transaction\_\_v) record.  Example: {{sample\_transaction\_\_v.submitted\_date\_\_v}} |
| {{totalNumberOfSampleLines}} | Returns the total count of individual sample line items included in the package label table.  Do not include this token in a table where the {{repeatRow}} token is used. |
| {{senderRepRoster.FieldAPIName}} | Retrieves field values from the Rep Roster (rep\_roster\_\_v) record of the user shipping the products.   * Transfers: transferred\_from\_\_v user * Returns: adjust\_for\_\_v user   Example:  {{senderRepRoster.address\_line\_1\_\_v}}  Do not include this token in a table where the {{repeatRow}} token is used. |
| {{recipientRepRoster.FieldAPIName}} | Retrieves field values from the Rep Roster (rep\_roster\_\_v) record of the user receiving the products.   * Transfers: transferred\_to\_\_v user * Returns: return\_to\_\_v field value   Example:  {{recipientRepRoster.address\_line\_1\_\_v}}  Do not include this token in a table where the {{repeatRow}} token is used. |
| {{sampleProductCatalog.FieldAPIName}} | Retrieves field values from the Product Catalog (product\_\_v) record associated with the sample item.  Example: {{sampleProductCatalog.manufacturer\_\_v}} |
| {{sample\_transaction\_\_v.lot\_\_vr.FieldAPIName}} | Retrieves field values from the Sample Lot (sample\_lot\_\_v) record associated with the specific sample line item.  Example: {{sample\_transaction\_\_v.lot\_\_vr.expiration\_date\_\_v}} |
| {{repeatRow}} | Repeat the row for each value returned by the defined criteria. Using this field on a package label results in rows for each sample transaction the user selects.  The token must be located in the leftmost cell of the row. |

### Uploading and Publishing Package Label Templates as

[![Closed](../../../../Skins/Default/Stylesheets/Images/transparent.gif)Sample Admin Users](#)

To upload and publish a new package label template:

1. Create a .**zip file** that contains both the .docx template file and, if tokens are used, the token-mapping .txt file. Place both files at the root level of the .zip.

Ensure the .zip file includes exactly one .docx file and one .txt/.tsv file. Both the .docx file and the .txt/.tsv file must have the same exact name as the .zip file. Non-UTF8 characters are not supported in the .zip file name. If the uploaded .zip file does not contain exactly one .docx and one .txt/.tsv file, or if the file names do not match the .zip name, processing fails.

2. Navigate to the **Library** tab.
3. Select **Create Document** from the Global Create button.
4. Select **Upload**.

   ![](../../../Resources/Images/SampleManagement/PackageLabel/SelectDocUpload.png)
5. Select **Continue**.
6. Upload the **.zip file** containing the .docx file and the token mapping text file (.txt or .tsv).
7. Select **Dynamic Word Template** as the Document Type.

   ![](../../../Resources/Images/SampleManagement/PackageLabel/UploadDoc.png)
8. Select **Next**.
9. Select the appropriate value from the **Dynamic Word Template Type** picklist:

* Select Sample Transfer Package Label for transfer templates
* Select Sample Return Package Label for return templates

![](../../../Resources/Images/SampleManagement/PackageLabel/SelectTypeCropped.png)

Product, Language, and Country values are not used for package labels, if populated in the Product Information section of the document's Information side panel. These values are used for other document types, for example, fax templates.

10. Ensure the **Publish for Veeva CRM (Fax)** option is set to No. If Publish for Veeva CRM (Fax) is set to Yes, the template is created as a [fax template](../../SendToFax/CreatingContent/CreateTemplates.htm) and output is limited to three pages.

    ![](../../../Resources/Images/SampleManagement/PackageLabel/PublishforFaxNocropped.png)
11. Select **Save**. For new templates, the contents of the .zip file are validated and processed at this point. When the .zip file is processed, the following files are generated:

* A .pdf rendition of the .docx file
* A .json file containing metadata for each token, including the location of merge fields within the template
* A .png file with a thumbnail image for the document, based on the first page of the .pdf rendition

12. Change the document lifecycle state to **Staged**. The .zip file and its extracted contents are published to the CDN. Admins can review file output at this stage to ensure package labels render correctly.

    ![](../../../Resources/Images/SampleManagement/PackageLabel/StagedState.png)

    Ensure the CDN Path field is populated and the CDN Processing Status displays as Success in the CDN Publishing Details section of the document's Information panel. If these fields are not populated by the CDN process, the Generate Package Label button is not selectable for end users.
13. Change the document lifecycle state to **Approved** to make the template available for use.

#### Updating Existing Templates

When updating an existing template, select the Process Content document action from the All Actions menu after uploading the updated .zip file and moving it through the Staged state to the Approved state. The Process Content document action validates and processes the content of the updated .zip file, generating new .pdf, .json, and .png files for the template.

If multiple templates are available for either package label type, the most recently modified version is used based on the Last Modified Date (modified\_date\_\_v) field on the Document record.

![](../../../Resources/Images/SampleManagement/PackageLabel/Copy of ProcessContentActionCropped.png)

### Generating Printable Package Labels as

[![Closed](../../../../Skins/Default/Stylesheets/Images/transparent.gif)End Users](#)

End users can generate a printable package label in .pdf format, containing a shipping label and manifest from a submitted sample transaction. Package labels are typically used when transferring products to another user or when returning products.

To generate a package label:

1. Navigate to the **Sample Transactions** tab in the Sample Management tab collection.
2. Select the **All Actions** menu for a submitted **Sample Transaction** record (Transfer or Return type).

   ![](../../../Resources/Images/SampleManagement/PackageLabel/Use/CreateLabelAction.png)
3. Select **Create Package Label**.
4. Review the list of **Transactions** on the selection page. The selection page displays transactions sharing the same Transfer To/From or Return To/Adjust For parties and addresses. Records created between 14 days prior and one day after the source transaction are included.
5. Select the transactions to include in the package. If the transaction is part of a [Multi-Line Transactions](MultiProduct.htm) group, all transactions in the group are automatically selected.

   ![](../../../Resources/Images/SampleManagement/PackageLabel/Use/SelectTransactionsCropped.png)
6. Select **Generate Package Label**. The label opens as a .pdf file in a new browser tab.

   |  |  |
   | --- | --- |
   |  |  |
7. Select **Print**.

### Related Topics

[Transferring Products](TransfertoOtherUsers.htm)

[Returning Products](ReturningProducts.htm)

[Generating Printable Sample Receipts](../../CallSampling/SubmitCallwSamples/SampleReceipts.htm)
