# Importing & exporting cross-reference lookups

## Introduction

If you prefer to maintain cross-reference lookup values externally, you can easily [export](#exporting-a-cross-reference-lookup) cross-reference lookups from Patchworks, update values as required, then [import](#importing-cross-reference-lookup-values) the updated file.&#x20;

## Need to know

#### Export file format

Cross-reference lookup exports are completed in CSV format, delimited ONLY with a single comma between fields.&#x20;

The exported file includes two columns with `left_value` and `right_value`  headers. For example:

{% code lineNumbers="true" %}

```
left_value,right_value
blue,#33ADFF
red,#FF5733
yellow,#FFF933
```

{% endcode %}

### Imports

#### Import approach

When cross-reference lookup values are imported:

* Existing values are checked and updated from the import file
* Existing values are checked against both left and right values
* New values are added

#### Import file format

To import cross-reference lookup values, the import file must be in the same format as export files [above](#export-file-format), **with the same headers**. I.e.:

{% code lineNumbers="true" %}

```
left_value,right_value
value,value
value,value
value,value
```

{% endcode %}

{% hint style="warning" %}
Import files cannot exceed 5MB.
{% endhint %}

## Exporting a cross-reference lookup

To export/download a cross-reference lookup, follow the steps below.&#x20;

**Step 1**\
Log into the Patchworks dashboard, then select **process flows** <mark style="color:orange;">|</mark> **cross-reference lookups** from the left-hand navigation bar.&#x20;

**Step 2**\
Click the **download** button associated with the cross-reference lookup that you want to export:

<div align="left"><figure><img src="/files/4JI6Wd1KiWIBsYxLrjmf" alt=""><figcaption></figcaption></figure></div>

**Step 3**\
The download job is added to a queue and a confirmation message is displayed:

<div align="left"><figure><img src="/files/0mbIBd9YW0Eavj4WA5xE" alt=""><figcaption></figcaption></figure></div>

**Step 4**\
When your download is ready, you'll receive an email which includes a link to retrieve the file from the **file downloads** page. If you can't/don't want to use this link, you can access this page manually by selecting the **settings** option:

<div align="left"><figure><img src="/files/hvl7x5MerEwLLtIyTQaE" alt="" width="214"><figcaption></figcaption></figure></div>

...followed by the **file downloads** option:

<div align="left"><figure><img src="/files/bhsqLHeCwsHwUkXdJHBt" alt="" width="563"><figcaption></figcaption></figure></div>

**Step 5**\
On the **file downloads** page, you'll find any exports that have been completed for your company profile in the last hour.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     &#x20;

<figure><img src="/files/GTnY7iisJDbuX9c7xwgb" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
This list may include exports from different parts of the dashboard, not just cross-reference lookups (for example, [run log](/product-documentation/process-flows/error-reporting-and-exception-handling/run-logs-and-queue/working-with-run-logs/downloading-run-logs.md) and [de-dupe data exports](/product-documentation/process-flows/building-process-flows/process-flow-shapes/advanced-shapes/de-dupe-shape/working-with-data-pools.md) are added here).
{% endhint %}

**Step 6**\
Click the **download** button for your job - the associated CSV file is saved to the default downloads folder for your browser.

{% hint style="info" %}
Download files are cleared after one hour. If you don't manage to download your file within this time, don't worry - just run the export again to create a new one.&#x20;
{% endhint %}

## Importing cross-reference lookup values

To import cross-reference lookup values, follow the steps below.&#x20;

**Step 1**\
Log into the Patchworks dashboard, then select **process flows** <mark style="color:orange;">|</mark> **cross-reference lookups** from the left-hand navigation bar.&#x20;

**Step 2**\
Click the name of the cross-reference lookup that you want to update:

<div align="left"><figure><img src="/files/ihLjbFwQJfdYPzWYZvKi" alt=""><figcaption></figcaption></figure></div>

{% hint style="info" %}
Existing values are always checked and updated if matched with your import file. If you don't want to update existing values, don't import them into an existing cross-reference lookup table. Instead, [create a new cross-reference lookup](/product-documentation/process-flows/cross-reference-lookups/adding-a-cross-reference-lookup.md) and import from there.&#x20;
{% endhint %}

**Step 3**\
Move to the lower **values** panel and click the **import values** button:

<div align="left"><figure><img src="/files/vZk6wdo1XSGokmyr30CO" alt=""><figcaption></figcaption></figure></div>

**Step 4**\
Navigate to the CSV file that you want to import and select it:

<div align="left"><figure><img src="/files/ZPMx8GkuQMXpWwzuPwdu" alt="" width="375"><figcaption></figcaption></figure></div>

**Step 5**\
The file is uploaded and displayed as a button - click this button to complete the import:

<div align="left"><figure><img src="/files/duPrSrzIuuJT1mgzUjw1" alt=""><figcaption></figcaption></figure></div>

**Step 6**\
The import is completed - existing values are updated and new values are added:

<figure><img src="/files/orLCUddbrN1wkhNSI3bq" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
You may need to refresh the page to view the updated data pool.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.wearepatchworks.com/product-documentation/process-flows/cross-reference-lookups/importing-and-exporting-cross-reference-lookups.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
