FacetFlux
imports.mappings.apply
Pure transform: apply column→attribute mappings to a list of source records and return per-row attribute payloads ready for downstream writes. NO DB writes happen here. Each rule maps `sourceColumn` (a key in the record) to `destinationAttributeDefinitionId` (an attribute definition in the target schema), with an optional `role` tag (uniqueIdentifier, productGroup, name, brand, category, mainImage, productType). The mapping engine performs type coercion against the destination's DataType (e.g. string '42' → 42 for Number) and reports per-row errors and warnings. Recommended downstream flow: use the role-tagged values (especially uniqueIdentifier) as the externalId for `pim.products.batch.create`, then write the per-row attributes via `pim.products.attributes.set`. Response: { targetSchemaId, ruleCount, recordCount, skippedRules: [{ ruleIndex, reason }], items: [{ rowIndex, isSuccess, attributes: [{ attributeDefinitionId, code, dataType, value }], roles: { [role]: value }, errors: [...], warnings: [...] }] }. Errors: { error: { code: 'not_found' | 'bad_input', ... } }.
Other tools also called imports.mappings.apply?
See providers with this name
Input Schema
{
"type": "object",
"properties": {
"targetSchemaId": {
"description": "Target schema id — drives target attribute lookup, validation, and type coercion.",
"type": "string"
},
"sourceSchemaId": {
"description": "Optional source schema id — used for source-attribute alias resolution. Pass null when the agent owns the column shape (typical for B1 onboarding from inline data).",
"type": [
"string",
"null"
]
},
"rules": {
"description": "Mapping rules. At least one required.",
"type": "array",
"items": {
"type": "object",
"properties": {
"sourceColumn": {
"description": "Source record column name. Direct key into each record's dictionary.",
"type": "string"
},
"destinationAttributeDefinitionId": {
"description": "Target attribute definition id (must belong to the target schema).",
"type": "string"
},
"role": {
"description": "Optional role marker. Allowed: uniqueIdentifier, productGroup, mainImage, category, brand, name, productType. The role-tagged values are returned per row in the `roles` map for easy extraction (e.g. take roles.uniqueIdentifier as externalId for pim.products.batch.create).",
"type": [
"string",
"null"
],
"enum": [
"Unknown",
"UniqueIdentifier",
"ProductGroup",
"MainImage",
"Category",
"Brand",
"Name",
"ProductType",
null
]
}
}
}
},
"records": {
"description": "Source records (≤500). Each record is a {column: value} object; values may be string, number, boolean, or null. Arrays/objects are passed through as raw JSON.",
"type": "array",
"items": {
"type": "object"
}
},
"strict": {
"description": "Strict mode: required-field misses become errors that fail the row (default false: they're warnings and the row still maps).",
"type": "boolean",
"default": false
}
},
"required": [
"targetSchemaId",
"sourceSchemaId",
"rules",
"records"
]
}