Attributes & Enrichment

Building Dependent Attributes with Insert Value

Use {{ }} tags and Required Values to create attributes that depend on other attributes. Build attribute chains where AI reads data from one field to enrich another.

On this page

Building Dependent Attributes with Insert Value

Merchkit's most powerful feature is the ability to create attribute chains—where one attribute's value feeds into another's enrichment. This lets you build smart, cascading workflows where AI reads data from multiple fields to generate richer content.

The mechanism behind this is Insert Value, the {{ }} tag syntax that lets you reference other attributes inside your enrichment prompts.

What Insert Value Does

When you reference another attribute using {{attribute_name}}, Merchkit substitutes that field's actual value for each product during enrichment. This means your AI prompt can read real data and make decisions based on it.

Example: A product titled "Leather Desk Chair" with price "$299" and color "Charcoal" can use all three values in a single prompt: "Create an SEO description for this {{product_title}} in {{color}}, priced at {{price}}."

How to Insert Values

You have two ways to add attribute references to your prompt:

  1. Type @ in the prompt field — Start typing @ and a dropdown appears showing all available attributes in your catalog. Select the one you want, and Merchkit inserts the {{ }} tag automatically.

  2. Click the "Insert Value" button — Located below the prompt field, this button opens an attribute selector panel. Click any attribute, and it gets added to your cursor position.

[SCREENSHOT: Prompt field with @ dropdown showing available attributes like product_title, brand, price, etc.]

[SCREENSHOT: Insert Value button below a prompt field, with attribute selector panel open]

Choose whichever method feels natural. Both produce the same result: clean, predictable {{ }} references in your prompt.

Required Values: Dependency Gating

Here's the key: what if a referenced attribute is empty for some products? Do you want enrichment to fail silently, or to skip that product entirely?

This is where Required Values comes in.

When you toggle an attribute as "Required," you're saying: "Don't run enrichment on this field until this dependency has data." If a product is missing a required value, Merchkit skips that product and moves to the next one. Once the dependency is filled in (manually, via another enrichment, or via a reference lookup), enrichment will pick up where it left off.

How to Use Required Values

  1. Click the "Required Values" button in your attribute configuration panel. This opens a toggle list of all attributes you've referenced in your prompt.

  2. Toggle ON any attribute that must have data before enrichment runs. Toggle OFF any attribute that's optional (used if available, but doesn't block enrichment if empty).

  3. Save your configuration.

[SCREENSHOT: Required Values panel showing toggles for product_title (ON), brand (ON), price (ON), material (OFF), color (OFF)]

This is how you build attribute chains. One attribute feeds another. Dependencies flow downward. Your enrichment respects these boundaries automatically.

Worked Examples

Here are three real-world patterns you'll use.

Example A: SEO Description with Multiple Text Attributes

Catalog: A furniture retailer, 37K products Attribute: seo_description (Text, AI ON)

This attribute references seven other fields in a single prompt:

Generate a compelling meta description (155 characters max) for this product.
Use the following information:
- Product: {{product_title}}
- Details: {{product_description}}
- Brand: {{brand}}
- Price: {{price}}
- Category: {{l2_category}}
- Material: {{material}}
- Style: {{style}}
- Color: {{color}}

Write in active voice. Include the brand name, material, and price point. Example: "Buy premium leather office chairs in charcoal by Acme Home. Free shipping over $500."

Required Values: Toggle ON product_title, brand, price, l2_category. Toggle OFF material, style, color (nice-to-have, but don't block).

Result: AI reads seven fields per product and generates a rich, context-aware meta description. A charcoal chair and a mahogany desk generate completely different descriptions because the prompt sees their actual data.

Tip: Start with 2–3 required values. Each additional dependency makes enrichment slower and more fragile.

Example B: Image Generation from Structured Data

Catalog: Sam DEMO, Wayfair channel Attribute: dimensions_line_drawing (Image, AI ON, Image Model: Nano Banana)

This is an advanced pattern: generating an image based on dimensional data.

Field Type: Image
Image Model: Nano Banana
Image Source: Product Images (as reference)

Prompt:
"Create a simple line drawing (not a photo) showing a {{product_type}} from a clear front angle.
Add dimensional lines for:
- Width: {{product_max_width_in}} inches
- Depth: {{product_max_depth_in}} inches
- Height: {{product_max_height_in}} inches
If available, include seat height: {{seat_height_in}} inches

Use a light gray background. Make the lines sharp and legible. This drawing should be usable in a product listing."

Required Values: Toggle ON the three dimensions (width, depth, height). Toggle OFF seat_height (useful if available, but some products don't have it).

Result: Merchkit generates a unique line drawing for each product, scaled and labeled with its actual dimensions. Sofas, chairs, and tables all get contextually correct drawings.

Why this pattern works: Image generation models need structured data to produce consistent, useful outputs. By referencing dimension attributes, you ensure every generated image is accurate to the real product.

Example C: Pricing Chain (Reference Lookup → AI → Formula)

Catalog: Merchkit Home, 211 products Channel: Internal pricing workflow

This pattern shows a three-step chain where one attribute feeds the next.

Step 1: Pricing Policy (Reference Lookup)

  • Attribute: pricing_policy (Reference Lookup, AI OFF)
  • References: Vendor entity
  • Example data: "MSRP = cost × 2.5. Minimum MSRP $50."
  • No AI involved. This just pulls vendor rules.

Step 2: MSRP (Number, AI ON)

  • Attribute: msrp (Number, AI ON)
  • Prompt: "Read the following pricing rules: {{pricing_policy}}. Extract the MSRP for this product. Return only the numeric value with two decimal places, e.g. 99.99"
  • Required Values: Toggle ON pricing_policy.
  • Result: AI interprets vendor rules and extracts the MSRP. Because pricing_policy is required, enrichment skips any product whose vendor is missing rules.

Step 3: MSRP + 15% (Formula)

  • Attribute: channel_price (Number, AI OFF, Formula)
  • Expression: {{msrp}} * 1.15
  • No AI. Pure calculation.
  • Result: Multiply enriched MSRP by 1.15.

The chain in action:

  1. Vendor pricing policy is pulled (Reference Lookup, no AI).
  2. AI reads the policy and extracts MSRP (AI enrichment, depends on step 1).
  3. Channel price is calculated from MSRP (Formula, depends on step 2).

Each step depends on the previous. If a vendor's pricing_policy is empty, steps 2 and 3 skip that product. Once the vendor data is added, the entire chain runs.

[SCREENSHOT: Attribute configuration showing pricing_policy reference lookup, with data like "MSRP = cost × 2.5"]

[SCREENSHOT: AI prompt for msrp attribute, showing {{pricing_policy}} reference]

[SCREENSHOT: Formula attribute for channel_price, showing {{msrp}} * 1.15]

Common Patterns

Text → Text: One attribute's content enriches another. E.g., product_description feeds seo_description, product_title feeds marketing_headline.

Structured Data → AI → Number: Dimensions, weights, or specs feed AI extraction. E.g., dimensions feed line drawing, specs feed technical summary.

Number → Formula: AI enrichment produces a number, which a formula then transforms. E.g., MSRP feeds markup calculation, rating feeds weighted score.

Multiple Sources → Single Output: A prompt references 5+ attributes to generate one rich field. E.g., seo_description in Example A uses 8 fields.

Tips for Success

  1. Start small: Build your first chain with just 1–2 dependencies. Once it works, add more.

  2. Test with a subset: Before running enrichment on all 37K products, enrich 10–20 and review the output. Does the AI read the referenced data correctly?

  3. Document your dependencies: Keep a simple list of which attributes feed which. E.g., "pricing_policy → msrp → channel_price."

  4. Use Required Values strategically: Toggle ON only attributes that truly block enrichment. Too many required values can halt your workflow.

  5. Validate attribute names: Typos in {{ }} tags cause silent failures. Double-check with the @ dropdown.

  6. Chain depth: Avoid chains longer than 3–4 steps. Each step adds latency and complexity. If you have more than 4 dependencies, consider splitting into multiple workflows.

Common Issues

Issue: "Attribute not found" in prompt Check your {{ }} syntax. Use the @ dropdown instead of typing manually—it avoids typos.

Issue: Enrichment is skipping all products You've toggled too many attributes as "Required" and they're all empty. Either fill those fields first, or toggle them to OFF and let enrichment run.

Issue: AI output doesn't use the referenced data The prompt may be ambiguous. Instead of "Use {{product_title}} if helpful," try "Begin your answer with {{product_title}}:" This makes the expectation explicit.

Issue: Inconsistent output across products Different data types (some titles are short, others are long) produce different outputs. Add constraints to your prompt: "Keep the description under 50 words" or "Always include the brand name."

Next Step

Your attributes are configured and chained together. Now it's time to see them in action.

Head to 3.8 — Working with Categories to understand how category-level attributes affect enrichment, especially when using multiple channels like Wayfair or Walmart.