Generate Templates With AI
Don't know exactly which fields your store needs? You don't have to figure it out manually. Use any AI assistant like ChatGPT, Claude, Gemini, or any other LLM to generate a complete template JSON file tailored to your specific store, then import it directly into Metafield Studio.
No coding required. No metafield expertise needed. Just describe your store and what you want.
How It Works
- Prompt an AI with a description of your store and what data you need
- Get a JSON file in Metafield Studio's import format
- Import the JSON into Metafield Studio
- Done your custom template is ready to use
The JSON Format
Every template JSON file follows this structure. Share this format with the AI so it generates a compatible file:
{
"version": "1.0",
"exportedAt": "2026-01-01T00:00:00.000Z",
"app": "Metafield Studio",
"sets": [
{
"resourceType": "PRODUCT",
"title": "Your Template Name",
"description": "What this template is for",
"status": "active",
"order": 0,
"fields": [
{
"label": "Field Display Name",
"namespace": "your_namespace",
"key": "field_key",
"type": "single_line_text_field",
"notes": "Help text for your team",
"order": 0,
"filterable": false,
"storefront": false,
"pin": false
}
]
}
]
}
Supported Resource Types
Use one of these values for resourceType:
PRODUCT, VARIANT, COLLECTION, PAGE, BLOG, ARTICLE, SHOP, LOCATION
Supported Field Types
Use one of these values for type:
| Type Value | What It Creates |
|---|---|
single_line_text_field | Single-line text input |
multi_line_text_field | Multi-line text with rich text editor |
number_integer | Whole number |
number_decimal | Decimal number |
date | Date picker |
date_time | Date and time picker |
boolean | True/false toggle |
color | Color picker with hex value |
url | URL input |
json | JSON data |
weight | Weight with unit |
volume | Volume with unit |
dimension | Dimension with unit |
rating | Star rating |
product_reference | Link to another product |
variant_reference | Link to a product variant |
page_reference | Link to a page |
file_reference | Link to a file |
list.single_line_text_field | List of text values |
list.number_integer | List of integers |
list.product_reference | List of product links |
Optional Field Flags
Each field also supports three optional boolean flags that control how the definition behaves in Shopify:
| Flag | Default | What It Does | Limit |
|---|---|---|---|
filterable | false | Makes this metafield available as a filter in the Shopify admin, so you can filter your product list (or other resources) by this field's value | 128 filterable definitions per store |
storefront | false | Exposes this metafield to the Storefront API with PUBLIC_READ access, making it available to your headless storefront, Hydrogen store, or any app reading your storefront data | No limit |
pin | false | Pins this definition to the top of the metafield section in the Shopify admin, so your team sees it immediately without scrolling | 20 pinned definitions per resource type |
When to use these:
- Set
"filterable": trueon fields you want to search/filter by in the Shopify admin (e.g., material, color, vendor SKU) - Set
"storefront": trueon any field whose value needs to appear on your storefront or be read by a headless app (e.g., SEO fields, product specs, size charts) - Set
"pin": trueon the most important fields your team fills in daily, so they're always visible at the top of the editor
You can include these flags in your AI prompt: "Make the grape_variety and region fields filterable, expose all fields to the storefront, and pin vintage_year and cupping_score."
Example AI Prompts
Click Copy on any prompt below to copy it with the full JSON format included, ready to paste into your AI assistant.
For a Wine Store
For a Pet Supply Store
For a Handmade Jewelry Store
For Multiple Resource Types
Pro Tips for Better AI Results
Be specific about your industry
Instead of "I sell stuff online", say "I sell organic skincare products, primarily serums and moisturizers, targeting ages 25-45." The more context the AI has, the more relevant the fields it generates.
Ask for validation rules
Add to your prompt: "Include appropriate validation rules for example min/max values for numeric fields, and maximum character lengths for text fields." The AI will populate the validationRules field with JSON constraints.
Ask for select/multi-select options
If you want dropdown fields, tell the AI: "For the 'skin_type' field, make it a single-select with options: Normal, Dry, Oily, Combination, Sensitive." The AI will include the options in the options field.
Request multiple templates at once
You can ask for several templates in a single prompt: "Give me three separate templates in the same JSON file: one for product specs, one for SEO fields, and one for shipping information."
Iterate
If the first result isn't perfect, tell the AI what to change: "Add a 'pH Level' decimal field to the product specs template, and remove the 'fragrance type' field." Refining is faster than starting over.
Importing Your AI-Generated Template
Once you have your JSON file:
- Navigate to the Templates section in Metafield Studio
- Click the "Import" button
- Upload your JSON file (drag-and-drop or click to browse)
- Metafield Studio validates the file and shows you a preview of what will be imported
- Select which templates to import (or click "Select all")
- Click Import
- Your templates are ready to use
The import process validates your JSON structure automatically. If the AI generated anything invalid (wrong field type, missing required properties), you'll see a clear error message telling you what to fix.
Save your AI-generated JSON files. They're a portable, version-controlled record of your metafield architecture. Store them in a shared drive or repository so your team can reference or reuse them.
Real-World Example: Complete Prompt and Output
Here's a complete example you can adapt:
Prompt:
The AI will generate a complete, valid JSON file that you can import directly into Metafield Studio giving you a professional-grade coffee product data structure in minutes instead of hours.