New Line - "\n" is not working in Run Script workflow
This content was last updated in 2024. It may still be useful, but could contain outdated information. Please confirm its accuracy before relying on it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2024 08:48 AM
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";
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2024 09:14 AM
use <br > ,it should work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2024 09:15 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2024 09:47 AM
I am getting above error with "<br>".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2024 11:01 AM
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.