New Line - "\n" is not working in Run Script workflow

Sarath Sathyan
Tera Contributor

in below code, /n is not working in Run Script workflow.
var fileContent = ritmNumber + " " + hostName + " " + stressTestDate + " " + sysId + "\n";

// Add the 24 timeframes

for (var i = 0; i < timeframes.length; i++)

{

var fromTime = timeframes[i].fromTime;

var toTime = timeframes[i].toTime;

fileContent += fromTime + " " + toTime + "\n";

}

 

4 REPLIES 4

Mani A
Tera Guru

use <br > ,it should work 

Sarath Sathyan
Tera Contributor

Screenshot 2024-09-20 221457.pngScreenshot 2024-09-20 221609.png

 

I am getting above error with "<br>".

Brad Bowman
Kilo Patron
Kilo Patron

How do you mean \n is not working - is there an error, or are you logging fileContent and not seeing these characters?  What are you doing with fileContent beyond this snippet?  <br> works when setting the value of an HTML field or variable.