Forum Discussion
Technically, this could have been accomplished with a single Mapper expression, but I thought the JSON Splitter would make it a little easier to understand the Object.mapKeys() expression.
- stephenknilans8 years agoContributor
You can use a mapper with the nullsafe option turned on, and specify the fields that you need on the source and target. That should give you a null value. You can also simply replace the source value with a string like:
((‘LAST_NAME’ in $)?$LAST_NAME: null)
This is basically two commands:
- (X in Y) which returns true if X is in Y. $ means the variables in this path.
- (X ? Y: Z) which means that if X is true then Y else Z
Related Content
- 4 months ago
- 11 months ago