Field Mapping

Map API response fields to YOOtheme source fields

Field Mapping

Field mapping defines how API response data becomes available in YOOtheme Pro's dynamic content system.

How Field Mapping Works

  1. API returns JSON data
  2. You define which fields to extract
  3. API Mapper makes those fields available as YOOtheme sources
  4. You use them in your page builder elements

Adding Fields

  1. Open your connection settings
  2. Go to the Fields section
  3. Click Add Field
  4. Configure the field:
    • Name: Display name in YOOtheme (e.g., "Product Title")
    • Path: JSON path to the data (e.g., title or product.name)
    • Type: Data type (Text, Number, Image, etc.)

Field Types

TypeUse ForExample
TextStrings, descriptionsProduct name, article body
NumberNumeric valuesPrice, quantity, ID
ImageImage URLsProduct image, thumbnail
LinkURLsProduct link, website
DateDate/time valuesPublished date, event date
BooleanTrue/false valuesIn stock, featured

JSON Path Syntax

Simple Paths

For top-level fields:

{
  "title": "My Product",
  "price": 29.99
}
  • Path: title → "My Product"
  • Path: price → 29.99

Nested Paths

For nested objects, use dot notation:

{
  "product": {
    "name": "Widget",
    "details": {
      "sku": "WGT-001"
    }
  }
}
  • Path: product.name → "Widget"
  • Path: product.details.sku → "WGT-001"

Array Items

For arrays, API Mapper automatically iterates:

{
  "items": [
    {"name": "Item 1", "price": 10},
    {"name": "Item 2", "price": 20}
  ]
}
  • Path: items[].name → Available for each item
  • Path: items[].price → Available for each item

JMESPath Transforms (Pro)

Pro Feature

JMESPath transforms require a Pro or Developer license.

For complex data transformations, use JMESPath expressions:

# Filter items by status
items[?status=='active']

# Get first 5 items
items[:5]

# Sort by price
sort_by(items, &price)

# Extract specific fields
items[].{name: title, cost: price}

JMESPath documentation →

Field Limits

FeatureFreeLiteProDeveloper
Fields per Connection510UnlimitedUnlimited
Loading...

Best Practices

  1. Use descriptive names - "Product Price" is better than "price"
  2. Match types correctly - Use Number for prices, not Text
  3. Keep it minimal - Only map fields you actually need
  4. Test your paths - Use the connection tester to verify

Troubleshooting

Field shows empty in YOOtheme

  • Verify the JSON path is correct
  • Check if the field exists in the API response
  • Ensure the field type matches the data

"Invalid path" error

  • Check for typos in the path
  • Verify the JSON structure with the connection tester

Next Steps

Was this page helpful?

On this page