Bunty11
Hot Shot
Hot Shot

VMWare vRO Workflow

My OutPut Variable in VRO has this data in single line.

like this

aaaaaa.bbbbbbb.ccccc.ddddd

i want to format that and keep it on different lines like this and sent email.vro

aaaaa

bbbbb

ccccc

dddd

how to format the variable which has this data in javascript ?

2 Replies
iiliev
VMware Employee
VMware Employee

Hi,

Check the following snippet which shows how all dot characters ('.') in a string can be replaced with newline characters ('\n').

var x = "aaaaaa.bbbbbbb.ccccc.ddddd";

System.log("original value: " + x);

var y = x.replace(/\./g, "\n");

System.log("formatted value: " + y);

stevedrummond
Hot Shot
Hot Shot

If you're sending a HTML email (as opposed to text) you'll want to replace them with <br /> and not the newline character.

const body = myVar.replace(/\./g, '<br />');

0 Kudos