{ "operator" : ["values" ... ] }. For example, { "cat" : ["I love", " ", "pie"] } results in “I love pie”.
Overview
JSONLogic provides a powerful way to transform and validate product data within calculated attributes. The platform supports both standard JSONLogic operators and custom extensions designed specifically for e-commerce use cases.Data access patterns
When writing JSONLogic formulas in Layers, you have access to two types of data:Catalog attributes
Reference existing catalog attributes using the_attribute: prefix followed by the attribute code:
Raw Shopify data
Access raw underlying Shopify data before transformation using the_raw:raw. prefix:
_raw:raw.variants- Array of product variants_raw:raw.featured_media- Featured image data_raw:raw.images- Array of product images_raw:raw.options- Product options
See also
- Standard Operators - All standard JSONLogic operators (data access, logic, comparison, arithmetic, array, string)
- Custom Layers Operators - Layers-specific extensions (lower, startsWith, endsWith, count, parseDate, daysSince, now)
- Examples & Best Practices - Complex examples and best practices
- Catalog Attributes - Managing searchable, filterable, and sortable attributes
- JSONLogic Official Documentation - Complete reference for standard operators
- Merchandising - Using calculated attributes in merchandising rules
- Sort Orders - Using calculated attributes for custom sorting