MapForce node functions simplify mapping hierarchical data such as XML nodes or CSV, JSON, EDI, or database fields by permitting users to define a data processing function at the node level and apply it recursively to all descendant items.
Similarly, default values can also be assigned to nodes and automatically applied to descendants.
Defaults and node functions are particularly useful when a data mapping and transformation task requires the same processing logic for multiple descendant items in a structure, for example:
- Replace null values with some other value, recursively for all descendant items
- Replace a specific value (for example, “N/A”) with some other value recursively for all descendant items
- Replace all database null values when reading from a database table
- Trim all trailing spaces for all values from a source database
- Append a custom prefix or suffix to all values written to a target file or database
- Formatting of output values
- And many others
Defaults and node functions simplify mapping hierarchical data by eliminating need to copy-paste the same function multiple times into a mapping. Repeating the same function unnecessarily clutters the mapping layout and makes it more difficult to understand or revise.
Let’s look at an example.