Forum Discussion
cjhoward18
4 years agoEmployee
Hi,
Using this expression in a Mapper snap:
$['Customer Security Segment'].split(";").reduce((accum, curVal, index) => accum.extend({[$['Customer Super Key'] + (index + 1)]: curVal }), {})
You can create the object you are looking for from the input given.
Thank you CJ!, that did the trick but it I also had to add an $.extend at the root level to achieve what I was going for, so my finally expression ended up looking like this in the mapper Snap:
$.extend($[‘Customer Security Segment’].split(“;”).reduce((accum, curVal, index) => accum.extend({["Customer Security Segment " + (index + 1)]: curVal }), {}))
Related Content
- 3 years ago
- 4 months ago
- 3 years ago
- 3 years ago
- 3 months ago