When using custom Javascript code to build a Virtual data resource field that references different values mapped in the transformation, the JSON.stringify should be referenced when joining the mapped values. Utilizing this tool escapes any illegal or special characters that might appear when the vendor sends out data and results in a valid data set.
Example:
return JSON.stringify(elements.join(', '));