Forum Discussion
Thanks for all your help.
I now have nearly what I am after. but how do I remove the white space and the beginning and end of the field names after the merge, i.e.
in the mapper I see;
$[’ Additional Comments ‘]
$[’ Risk Comments ‘]
$[’ Automation author ']
and I would like to see
$Additional Comments or $Additional_Comments
$Risk Comments or $Risk_Comments
$Automation author or $Automation_author
Thanks
Peter
first trim the key then do a replace of spaces with underscore
$obj = " word of the day = my very energetic mother just serve us nine pie[CRLF][CRLF]HeHeheHeHehEhe "
sl.ensureArray($obj).toObject((x,y)=> x.split(‘=’)[0].trim().replace(/\s/g,‘_’), (x,y)=> x.split(‘=’)[1].replace(/[CRLF]/g,‘\r\n’))