> For the complete documentation index, see [llms.txt](https://docs.pakk.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pakk.io/data-and-integrations/data-import-and-export/import/referencing-other-records.md).

# Referencing Other Records

A classic pain point in CSV imports is when you need to reference other records.

For example:

* importing products, you need to set tax codes
* importing products, you need to set which websites they are on
* importing products, you need to set which categories they are in
* importing products, you need to set preferred supplier
* importing customers, you need to set which source website they came from

In all of these cases, it's key to understand what's going on here. When you set a reference, you are not just hard-coding a value. For example, when I set the category of a product, I am not just setting a name - I am actually pointing it to that record on the system.

Key to getting this right is understanding how to refer to other records. It's actually quite simple: you use their *primary identifier*. Important - that's not their internal ID of the the form `34ng8484nn3f993f3f3` - that would be ugly and hard for non-techies to manipulate. Instead, each record has a more "human" name you can reference it by that we call *primary identifier*.

How do you know the *primary identifier* of a record? Just do an export - you'll find the `!pid` field on every export. Here are some examples of primary identifiers for different entities:

* Product Category - `name` e.g. "Fresh Food"
* Customer - `email` e.g. <iamcustomer@me.com>
* Website - `name` e.g. "Retail Website"

It's crucial to write the *primary identifier* EXACTLY correctly including capitals, spaces and punctuation - close won't do! Computers are dumb and even a single mistake will mean that the import will fail because it won't be able to cross-reference the record. Typically, you won't be writing these references by hand - you'll either be copy-pasting them from the CSV exports, or better yet you'll be using `VLOOKUP` in excel to cross reference them from your own data sheets. If that sounds like tech babble - don't worry, it's not that hard. Either search for "Excel VLOOKUP" and watch a few tutorials or ask for help. VLOOKUP is a secret weapon in Excel, especially for every-day commerce data manipulation, so it's worth knowing.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.pakk.io/data-and-integrations/data-import-and-export/import/referencing-other-records.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
