Skip to content
Get in touch

Mapping

A schema for mapping data from one schema to another.

A JSON example of this model.

{
"id": {"const": "123"},
"name": {
"firstName": {"field": "first_name"},
"lastName": {"field": "last_name"},
},
"opportunity": {
"status": {
"switch": {
"field": "opportunity_status",
"case": {
"active": "open",
"inactive": "closed",
}
}
},
"amount": {"field": "opportunity_amount"},
}
}

A function for mapping data from one schema to another.

Sub-typeDescription
MappingConstantFunctionReturns a constant value.
MappingFieldFunctionReturns the value of a field in the source data.
MappingSwitchFunctionReturns a new value based on the value of a field in the source data using a switch-case lookup.

A JSON example of this model.

{
"id": {"const": "123"},
"name": {
"firstName": {"field": "first_name"},
"lastName": {"field": "last_name"},
},
}

Returns a constant value.

PropertyTypeDescription
conststringA constant value to add to the mapping.

A JSON example of this model.

{
"const": "123",
}

Returns the value of a field in the source data.

PropertyTypeDescription
fieldstringA dot-separated path to a field in the source schema whose value will be added to the mapping.

A JSON example of this model.

{
"field": "opportunity_status",
}

Returns a new value based on the value of a field in the source data using a switch-case lookup.

PropertyTypeDescription
fieldstringA dot-separated path to a field in the source schema whose value will be added to the mapping.
caseRecord<unknown>A mapping of source field values to desired output values.
defaultunknownThe default value to output if no case matches the source field value.

A JSON example of this model.

{
"field": "opportunity_status",
"case": {
"active": "open",
"inactive": "closed",
},
"default": "custom",
}