Rule data: metafields, properties, metaobjects, variables
The custom data a rule can read: product, variant, and shop metafields, line item properties, cart attributes, synced metaobjects, and computed variables and line groups.
Data access
Each function declares what custom data it needs under Data access. This is turned into the input query the Function runs with, which keeps checkout fast and keeps the app within Shopify’s query limits.
| Source | Per function | Plan |
|---|---|---|
| Product metafield | 1 | Basic |
| Variant metafield | 1 | Basic |
| Shop metafield | 1 | Basic |
| Line item properties | up to 3 keys | Basic |
| Cart attribute | 1 | Basic |
| Metaobject definition | 1 | Advanced |
Metafields
Choose the namespace and key. Conditions can test the value and discount values can be sourced from it, so a custom.discount_percent metafield can drive a per-product percentage. See metafield-driven discounts.
Line item properties and cart attributes
Properties are set by the theme on add to cart, for example _bundleUniqueId for mix and match, or an engraving text. Properties prefixed with an underscore are hidden from the shopper. Cart attributes are set once per cart, for example a quiz result or a delivery slot. Both can be used in conditions and in merge or expand rules.
Metaobjects (Advanced)
Link a metaobject definition to a function and the app syncs its entries. Rules can read entry fields, so a table of offers, tiers, or component lists lives in Shopify admin and merchandisers edit it without touching rules.
Variables and line groups (Advanced)
A line group selects a set of cart lines (by collection, tag, property, or metafield) and exposes their total quantity, amount, and line count. A variable is a computed number, such as floor(groupQuantity / 5), usable as a condition value, a target quantity, or part of a discount value. Together they express offers that depend on cart arithmetic: any 5 for 60, capped accessory discounts, and repeating buy X get Y.
Updated