> For the complete documentation index, see [llms.txt](https://docs.samita.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.samita.io/bulk-price-editor-sami/field-guides/dynamic-variables.md).

# Dynamic variables

Insert values from other product and variant fields into your text edits.

Text inputs that show an **Add dynamic variables** link can contain placeholders. When the task runs, each placeholder is replaced with the value from that product or variant.

<figure><img src="https://1559832597-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fw4HtMDNMyRJ8FelzhTov%2Fuploads%2Fgit-blob-99541f4b1f2b8268fe62ca8ef8ae4762e2b2fed3%2Fdynamic-variables.png?alt=media" alt="Add dynamic variables dialog with Use field set to Product title and Text case set to No change"><figcaption><p>Add dynamic variables</p></figcaption></figure>

## Insert a variable

1. Click **Add dynamic variables** above the input.
2. Choose the **Use field**.
3. Choose a **Text case**: **No change**, **UPPERCASE**, **lowercase** or **Title Case**.
4. Click **Add**. The placeholder, for example `{{ product.vendor | upcase }}`, is appended to the input. You can also type placeholders by hand.

## Available variables

| Product fields             | Placeholder                        |
| -------------------------- | ---------------------------------- |
| Product title              | `{{ product.title }}`              |
| Product ID                 | `{{ product.id }}`                 |
| Product handle             | `{{ product.handle }}`             |
| Product type               | `{{ product.type }}`               |
| Product vendor             | `{{ product.vendor }}`             |
| SEO title                  | `{{ product.seo_title }}`          |
| SEO description            | `{{ product.seo_description }}`    |
| Product URL                | `{{ product.url }}`                |
| Product status             | `{{ product.status }}`             |
| Product tags               | `{{ product.tags }}`               |
| Product category           | `{{ product.category }}`           |
| Product category full name | `{{ product.category_full_name }}` |

| Variant fields (variant tasks only) | Placeholder                             |
| ----------------------------------- | --------------------------------------- |
| Variant ID                          | `{{ variant.id }}`                      |
| Variant title                       | `{{ variant.title }}`                   |
| Variant sku                         | `{{ variant.sku }}`                     |
| Variant barcode                     | `{{ variant.barcode }}`                 |
| Variant tax code                    | `{{ variant.tax_code }}`                |
| Variant country code of origin      | `{{ variant.country_code_of_origin }}`  |
| Variant province code of origin     | `{{ variant.province_code_of_origin }}` |
| Variant HS code                     | `{{ variant.hs_code }}`                 |

Text case is applied with a filter: `| upcase`, `| downcase` or `| titlecase`. IDs have no text case options.

## Where you can use them

Title, Description, Handle, Vendor, Product type, Theme template, SEO title, SEO description, SKU, Barcode, HS code, Tags, Option value 1 to 3, the Google Shopping text fields, and the find/replace inputs of custom metafields.

Numeric fields (Price, Compare at price, Cost price, Weight), choice fields, collections, sales channels and pickers do not accept variables.

## Examples

| Goal                          | Field and method               | Value                                             |
| ----------------------------- | ------------------------------ | ------------------------------------------------- |
| Add the vendor to every title | Title, Add text at end         | `by {{ product.vendor }}`                         |
| Generate SEO titles           | SEO title, Replace entire text | `{{ product.title }} \| {{ product.vendor }}`     |
| Tag products with their type  | Tags, Add tags                 | `{{ product.type \| downcase }}`                  |
| Build unique SKUs             | SKU, Replace entire text       | `{{ product.vendor \| upcase }}-{{ variant.id }}` |

The preview resolves the variables so you can check the result before saving.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.samita.io/bulk-price-editor-sami/field-guides/dynamic-variables.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
