# Lookups

In certain scenario's it might be required to maintain a statis **Lookup** file in Exivity. For example, when no logical mapping can be done from certain cloud resources such as mapping of VMware datastores, Azure Resource Groups, T-Shirt Size / Flavor VM's, etc. To apply business logic such as Disk Tiering or Customer identifications, a static **Lookup** file can be a useful tool to close this gap in your data feed. In this chapter, we explain how to create, import and use a **Lookup** file in Exivity.

## Creating Lookups

To create a new **Lookup** file, browse to the **Data Pipelines** > **Metadata** menu and then click the **Create** **Lookup**. To create a new empty **Lookup**, provide a *name* and specificy the amount of *columns* and *rows* that you'll need (don't worry - you can add/remove columns and rows later):&#x20;

![Creating a new Lookup](https://3540922554-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LHEKskLK6aXinV75Knl%2F-LqkJUUzAIZQtANFcuPe%2F-LqkRwFpheiESwafgVF5%2Fimage.png?alt=media\&token=b54db30c-9397-4bcf-bcbb-50d230fbe0b9)

After clicking the **Create** button an Excel-like grid will be shown. The first *row* of the lookup is considered the header which is mandatory. All rows afterwards are values that can be filled in according to your use case. In this example, we're creating a static mapping for *VMware Datastores*, where each *Datastore* relates to a specific *Department*:

![Adding values to a lookup file](https://3540922554-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LHEKskLK6aXinV75Knl%2F-LqkJUUzAIZQtANFcuPe%2F-LqkSYmMpeRGnlgeTOQG%2Fimage.png?alt=media\&token=e4791d79-ab84-4e7c-81e6-d7d339068f84)

In case you want to remove or add a column/row: by right-clicking anywhere in the grid a pop-up will be shown from where you can chose to add/remove a column/row:

![Adding and removing columns and rows](https://3540922554-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LHEKskLK6aXinV75Knl%2F-LqkJUUzAIZQtANFcuPe%2F-LqkTM3nruVGT__hpt5J%2Fimage.png?alt=media\&token=789fe7db-f077-45e1-9420-4c7e4e952826)

When you are finished, click the **Update** button.

{% hint style="warning" %}
NOTE: make sure there are **no empty rows** at the end of your lookup file. Failing to do so may cause an import error when using the **Lookup** in a **Transformer**
{% endhint %}

## Importing Lookups

In case you already have a Lookup file which you have created elsewhere (i.e. Excel sheet, or CSV export from a CMDB), Exivity offers you the ability to create a **Lookup** by importing that file. &#x20;

To import a CSV or Excel sheet as a **Lookup** file, browse to the **Data Pipelines** > **Metadata** menu and then click the **Create** **Lookup**. Now click the **Import** button in the area of the screen which is labelled as *Use existing.* Now it is possible to make some final changes to your file. Once finished, press the **Update** button to save your changes.

{% hint style="warning" %}
NOTE: make sure there are **no empty rows** at the end of your lookup file. Failing to do so may cause an import error when using the **Lookup** in a **Transformer**
{% endhint %}

## Using Lookup file in a Transformer

Once a **Lookup** is created, it is possible to import it in a [Transformer ](https://olddocs.exivity.io/3.4.3/transform#overview)as a [DSET ](https://olddocs.exivity.io/3.4.3/advanced/digging-deeper/dataset-lifecycle#dsets)for correlating datasets and other use cases. Before opening your **Transformer**, the first thing to do is obtaining the correct **Lookup** file path for importing.&#x20;

To obtain this path, first open the **Lookup** using the *Lookups* menu. Then click the *Copy* icon to the right of the *FILENAME*:

![Copy Lookup path](https://3540922554-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LHEKskLK6aXinV75Knl%2F-LqkgGTbpCoxpatULWDv%2F-LqkkHBDmeUtG86cROTC%2Fimage.png?alt=media\&token=ac9c76f1-2ef5-4df3-b81f-45cfdeee94bc)

Once this has been done, now open your **Transformer**, and past the path of your **Lookup** as part of an [import ](https://olddocs.exivity.io/3.4.3/transform/language/import#import-from-csv-files)statement:

![Importing a statis Lookup in a Transformer](https://3540922554-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LHEKskLK6aXinV75Knl%2F-LqkgGTbpCoxpatULWDv%2F-Lqkl8WjswIVlBD_4Tjl%2Fimage.png?alt=media\&token=4c6ff16f-3200-49be-a651-41c1b38b777e)
