Data Injector Component
UI Component
Changed on:
7 Sept 2026
Overview
The Data Injector is a Mystique content component that copies values from the current data context into a nested array or object, so descendant components can read data that would otherwise sit outside their scope.It does not render any visible UI of its own - it enriches the data passed to its descendants.| Plugin Name | Core |
|---|
Alias
fc.data.injector
Detailed technical description
What Gets Injected
The Data Injector reads from the current`DataContext` (or from an optional `data` prop when you want to override the context) and writes selected values onto a target identified by the `source` prop:- When
`source`resolves to an array, the injected keys are merged onto each item, preserving the item's other keys - When
`source`resolves to an object, the injected keys are merged onto that object - When
`source`resolves to a primitive (a string or number), the data is passed through unchanged - A missing path, or an explicit
`null`/`undefined`, resolves to an empty object (`{}`) and is treated as the object case - it receives only the injected keys
`inject` is read from the data by its `path` and written onto the target under a key:`path`is a dot-path such as`locations`or`node.retailer`- The written key is the entry's
`alias`; when no`alias`is given it defaults to the last segment of`path`(so`node.retailer`is written as`retailer`, and`locations`as`locations`) - If an
`inject`path does not exist in the data, it resolves to an empty object (`{}`) on the target
Behavior
- The
`source`must resolve to an object or an array of objects. When`source`is an array, every item is merged unconditionally - the component does not check that each item is an object - so non-object items are not supported:`null`, numbers, and booleans are replaced by an object containing only the injected keys- strings are expanded into character-indexed keys
- A nested
`source`dot-path (for example`strategy.fulfilments`) is deep-set, preserving the surrounding keys - The component does not mutate the source data - the enriched copy is passed to descendants as a data override, so the original context is untouched
- An empty
`source`array and an empty`inject`list are both handled without error
`category: content`.Explanation Through an Example
With`source: "fulfilments"` and `inject: [{ path: "locations", alias: "locs" }]`, the sibling `locations` array is copied onto every fulfillment item under `locs`:1{
2 "fulfilments": [
3 { "location": { "ref": "F_1722", "name": "Sydney Warehouse" } },
4 { "location": { "ref": "F_1850", "name": "Melbourne Warehouse" } }
5 ],
6 "locations": [
7 { "ref": "F_7777", "name": "Melbourne Warehouse" }
8 ]
9}1{
2 "fulfilments": [
3 {
4 "location": { "ref": "F_1722", "name": "Sydney Warehouse" },
5 "locs": [{ "ref": "F_7777", "name": "Melbourne Warehouse" }]
6 },
7 {
8 "location": { "ref": "F_1850", "name": "Melbourne Warehouse" },
9 "locs": [{ "ref": "F_7777", "name": "Melbourne Warehouse" }]
10 }
11 ],
12 "locations": [
13 { "ref": "F_7777", "name": "Melbourne Warehouse" }
14 ]
15}Properties
| Name | Type | Required | Default | Description |
`source` | `string` | Yes | None | Dot-path to the array or object within the data to enrich (for example `fulfilments` or `strategy.fulfilments`) |
`inject` | `InjectItem[]` | Yes | None | List of values to read from the data and write onto the `source` target |
InjectItem
| Name | Type | Required | Default | Description |
`path` | `string` | Yes | None |
|
`alias` | `string` | No | None | When the target key already exists on the item, the injected value overwrites the existing one (to avoid the repeating value overwriting) |
Configuration example
1{
2 "component": "fc.data.injector",
3 "props": {
4 "source": "fulfilments",
5 "inject": [
6 { "path": "locations", "alias": "locs" }
7 ]
8 },
9 "descendants": []
10}Version History
Recommended Placement
Wrap the descendant components that need the enriched data. The Data Injector renders only its descendants, so place it in the component tree at the point where a nested array or object must gain access to sibling data - for example, making shared location data available to nested strategy or fulfillment items in the Sourcing tab manifests.