Data Mapping
This section will cover how Data Mapping is managed. This concept is used for file imports, data transformation, and mapping between different existing Data Schemas.
Data model
Data mapping is defined with this structure. If you exclude functions, it's a simple array of connections between the source and target Data Schemas.
Mapping functions
Mapping functions let you augment the input value before assigning it. You can chain multiple functions together to create complex transformations.
Mapping functions can have multiple inputs/outputs. For example you can concat or split a string.
Mapping functions: Concatenate
Combine multiple input attributes into a single output string.
The value will be available if you use the connection Key: Result in combination with this function's ID as the connection path.
Mapping functions: Split
Split an input string value into multiple outputs.
The value's Key will be available as a string index of the split result. Eg: splitting "Hello World" by space would give you "0" as "Hello" and "1" as "World".
If the split fails for any reason, then the "0" output will be set to the original input value. Other outputs are set to empty strings.
Mapping functions: Replace
Run a string replace on an input value to get a new value.
Set the input value to the connection Key: Input to use this function.
The value will be available if you use the connection Key: Output in combination with this function's ID as the connection path.
Mapping functions: DateTime conversion.
Specify how your date string should be interpreted so we can store a valid ISO 8601 string.
If your strings are already in ISO 8601 format, you can skip this function and assign the value directly.
We store all dates in UTC so specifying a timezone that isn't UTC will result in a conversion to UTC.
Mapping functions: Calculate
This is a general-use calculation function where you can run Javascript eval code to get a new value.
The code will use $A, $B, etc as placeholders that will be replaced with your input values.
The value will be available if you use the connection Key: Result in combination with this function's ID as the connection path.
WARNING: Nulls are not currently handled gracefully. Ensure all your inputs are at least an empty string.
API utilities
We're working on improving our utilities to help generate these mappings.
Here is an experimental endpoint you can use.