Skip to content

Mapping

A schema for mapping data from one schema to another.

The following mapping:

{
"id": { "const": "123" },
"opportunity": {
"status": {
"switch": {
"field": "summary.opportunity_status",
"case": { "active": "open", "inactive": "closed" },
"default": "custom"
}
},
"amount": { "field": "summary.opportunity_amount" }
}
}

A JSON example of this model.

{
"id": { "const": "123" },
"opportunity": {
"status": {
"switch": {
"field": "summary.opportunity_status",
"case": { "active": "open", "inactive": "closed" },
"default": "custom"
}
},
"amount": { "field": "summary.opportunity_amount" }
}
}
Version Changes
0.2.0
  • Added MappingSchema model

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.

PropertyTypeRequiredDescription
const unknown Yes

A JSON example of this model.

{
"const": "123",
}
Version Changes
0.2.0
  • Added MappingConstantFunction model

Returns the value of a field in the source data.

PropertyTypeRequiredDescription
field string Yes

A JSON example of this model.

{
"field": "opportunity_status",
}
Version Changes
0.2.0
  • Added MappingFieldFunction model

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

PropertyTypeRequiredDescription
switch record Yes

A JSON example of this model.

{
"switch": {
"field": "opportunity_status",
"case": {
"active": "open",
"inactive": "closed"
},
"default": "custom"
}
}
Version Changes
0.2.0
  • Added MappingSwitchFunction model