Skip to main content
The Value Composer is the per-field configuration inside a Data Sync. For every field in the target Data Storage, it defines how that field’s value gets produced from the incoming feed record. A Data Sync does two things: it maps the integration’s channels and translations onto your project’s scopes and locales, and it holds the Value Composer configuration that defines what every field of the target record becomes. This page covers the second part.
Value Composer runs at sync time — it produces the values that land in a storage record. To include a value from another storage without syncing it in, see Mapped fields — they resolve as the response is built, so the value appears alongside the stored fields.
Buddy can read, create, debug, and manage Value Composer configurations for you. Describe the source shape and the target shape, and Buddy will build a working configuration — often faster than setting it up by hand. You can always refine the result in the UI afterward.

Four slot modes

Each field in the storage mapping is a slot. Every slot operates in one of four modes:
ModeWhat it doesWhen to use it
Schema FieldMaps a field directly from the feed recordStraight field renames, 1:1 mappings
Computed ValueBuilds the value through a chain of operationsReshaping, conditional logic, combining, transforming
Static ValueSets a fixed value that never changesFlags, defaults, brand-wide constants
Keep EmptyLeaves the field untouched during syncFields you don’t want to populate yet
Schema Field and Static are straightforward — pick a source field or enter a constant. Computed Value is where the Value Composer becomes interesting: a declarative language of chainable operations that take feed fields, static inputs, and the output of other operations as arguments.
Compose Value dropdown showing four slot modes: Schema Field, Computed Value, Static Value, Keep Empty

Operations

Computed Value mode gives you access to a wide range of operations across categories like logic, comparison, text, math, array, object, and transform. Operations are type-aware — the UI only shows operations compatible with the slot’s expected output type, so you don’t have to memorize what’s available. See the Value Composer reference for the full catalogue with arguments and return types.

Working with slots

Every slot in the composer can be switched between the four modes. When you select Computed Value, a dialog opens where you build the operation chain visually.
Compose Value dialog showing an IF operation with condition, then, and else slots configured

Copy, paste, and wrap

Slots support clipboard operations that speed up repetitive work:
  • Copy a slot’s configuration to reuse it on another field
  • Paste a copied configuration into a different slot — the UI checks type compatibility before allowing it
  • Wrap an existing slot inside a new operation. For example, wrap a Schema Field in an if to make it conditional, or wrap a concat result in tolower to normalize it. The UI shows which operations are compatible wrappers for the current slot type.

Iteration context

When working inside an array mapping (e.g. transforming an array of images into an array of MediaFile composites), the Value Composer provides special variables:
  • $item — the current element in the array being iterated
  • $parent — access the parent iteration context when nesting arrays inside arrays
For example, if each image has a list of size variants, use $item.url for the current variant and $parent.alt for the parent image’s alt text.

Auto-complete from feed schema

When selecting a Schema Field, the UI auto-completes from the feed schema. If a field doesn’t appear in auto-complete, either the schema hasn’t been inferred yet (no records have arrived) or the field needs to be added manually in the feed’s Schema tab. You can also create new feed schema fields directly from the composer UI.

Debug configurations

The Value Composer has a built-in debugger that runs your configuration against a JSON payload. Load an initial payload from a feed record with Search Record, paste your own, or edit the current one at any time — the payload persists between runs and is fully yours to manipulate. It’s not connected to the live record, so changes you make stay until you load a different one. The payload is shared across both debugger levels.

Field-level debugger

Open the debugger from the Compose Value dialog to test a single field’s configuration in isolation:
Field-level debugger showing node-wise output alongside the Compose Value configuration, with Search Record and Edit Payload buttons
  • Node-wise output — see what each operation in the chain produces before it feeds into the next
  • Live updates — results refresh as you modify the configuration

Record-level debugger

Record-level debugger showing complete output for all storage fields with error highlighting
Test all field configurations at once across the entire storage mapping:
  • Runs every slot’s configuration against the selected record
  • Shows the complete output for each storage field
  • Highlights fields with errors so you can spot broken configurations without checking each one individually
Use the field-level debugger while building individual compositions, and the record-level debugger as a final check before activating the sync.

Worked examples

The examples below use a sample product record. Each covers a pattern that shows up in most Data Syncs. Each example below comes from a working Samples Data Sync configured against the payload above. The hero shot shows all four mappings side by side; each example then zooms in on the field-level debugger with the live result.
Samples Data Sync mapping page showing the configured title, availability, options, and colorHex slots

Example 1: Concatenate values

Combine vendor.name and the top-level name into a single title field — producing “Apple - iPhone Pro”.
  1. Switch the title slot to Computed Value and add concat — it exposes three slots: value1, value2, separator.
  2. Wire value1 to Schema Fieldvendor.name, value2 to Schema Fieldname, and separator to Static Value-.
  3. Open the field-level debugger to see the result update against the loaded payload.
When you pick a Schema Field like vendor.name, the composer renders it as a nested GET block — the key slot holds name and the object slot holds vendor — rather than a single chip. The breakdown just makes the path explicit; the behavior is identical.
Field-level debugger for the title slot showing concat with vendor.name, name, and a dash separator, output Apple - iPhone Pro

Example 2: Conditional logic into an Enum

Set the availability enum (members in-stock, out-of-stock, preorder, backorder) based on whether the record has any stock.
When the target slot is an Enum, Static Value lets you pick a member from a dropdown — you don’t type the key. The Value Composer treats the enum like any other typed slot, so an if returning two static enum values is a clean fit.
  1. Switch the availability slot to Computed Value and add if. It has three slots: condition, then, else.
  2. Set condition to Computed ValuegreaterThan, with valueSchema Fieldstock and compareStatic Value0.
  3. Set thenStatic Valuein-stock and elseStatic Valueout-of-stock (both from the Enum dropdown).
With the sample payload (stock: 15), the result is in-stock. Click Edit Payload and change stock to 0 to flip it to out-of-stock.
Field-level debugger for the availability slot showing the if and greaterThan chain returning the in-stock enum member

Example 3: Array transformation

Transform the feed’s properties array — items like { id, label, value } — into the storage’s options field, an array of Option composites (attribute / label / value). Array transformations are configured inline on the mapping page, not in a separate dialog: the storage’s options row exposes a reference array slot plus one slot per sub-field of Option, all visible at once.
  1. On the options row, set the reference array to Schema Fieldproperties. This is what the composer iterates over — one Option per source element.
  2. Inside the iteration, each sub-field maps from the current element using $item:
    • attributeSchema Field$item.id
    • labelSchema Field$item.label
    • valueSchema Field$item.value
If properties doesn’t show up in auto-complete, the feed schema hasn’t picked it up yet. Add the field manually on the Data Feed’s Schema tab, or type it in and confirm — the schema accepts new fields you declare from the composer.
Data Sync mapping page with the options field expanded showing $item.id, $item.label, and $item.value bound to the attribute, label, and value sub-fields

Example 4: Extract a single value from a nested array

Example 3 mapped every property — but often you just need one. Here, extract the color hex out of the same properties array and store it on the top-level colorHex field, ready to render as a swatch.
  1. Switch the colorHex slot to Computed Value and add findFirst — it has an array slot and a filterFunction slot.
  2. Set array to Schema Fieldproperties. Then on filterFunction, add equals and wire its value slot to Schema Field$item.id and its compare slot to Static Valuecolor. This keeps only the property whose id is color.
  3. findFirst returns the whole matched object; we want just its value. Wrap the findFirst slot in get, then set get’s key to Static Valuevalue.
Against the sample payload the debugger returns #2F4F4F.
Field-level debugger for the colorHex slot showing the nested findFirst and get chain returning the color hex value

Tips

  • Start with Schema Field, upgrade when needed. Most fields start as direct mappings. Switch to Computed Value when you discover the simpler mode can’t express what you need.
  • Use the debugger early and often. The field-level debugger shows node-wise output, so you can pinpoint exactly which operation in the chain produces the wrong result.
  • Use wrap to extend existing configurations. Need to lowercase a mapped field? Don’t rebuild — wrap the existing Schema Field slot in a tolower operation.
  • Edit the payload when real data hasn’t arrived yet. Craft a test input that exercises the edge cases you care about without waiting for production data.
  • Cast types when they don’t match. Source data often has numbers as strings (e.g. "123" instead of 123). Use toNumber, toBoolean, or toString to make sure the value matches the storage field type — a price field expects a number, not a string that looks like one.
  • Watch the feed schema. Fields you reference need to exist in the schema. If auto-complete isn’t finding a field, check the feed’s Schema tab or add it manually.
  • Let Buddy build the first draft. Describe the source shape and the target shape, and Buddy will propose a working configuration you can refine in the UI.

Data Storages

Storage schemas, field types, and how Data Syncs connect feeds to storages.

Ingest Data

Connectors and Data Feeds — where the source records come from.

Value Composer reference

Complete catalogue of every operation with arguments and return types.

Storage Field Types

The field types your storage supports and that composer outputs must match.