Adding Multiple Lines To Data Field
I'm currently working on outputting multiple object to the Description field in a work item and was wondering how to insert a newline in between the data points? I've tried the usual `n and `r`n to no avail. Can anyone help me out?
Best Answers
-
Brian_Wiest Customer Super IT Monkey ✭✭✭✭✭
In SCORCH right click the field and choose expand.
Layout your datapoints as you want them in the description field.
6 -
Peter_Miklian Customer Advanced IT Monkey ✭✭✭
Yes, you can use PowerShell activities in your runbooks to update items, too.
5 -
Brad_Zima Member Advanced IT Monkey ✭✭✭
I wanted to update anyone who might stumble across this in the future. When I wrote the post I was using a copy of @Adam_Dzyacky's Add-ActionLogEntry function which can be found in the SMLets Exchange connector script. There appears to be some weird conversion going on when passing a string with escaped chars to the function.
The solution was to use "`r`n" to create a newline when passing to the function. When using direct SMLets I believe @Peter_Miklian's example above should be sufficient.
Edit: I should specify this isn't the exact answer to the question I had at the time, but it is the second post that comes up when searching for the terms "Powershell newline" in the community so it seemed like a good place to put it.
1
Answers
@Brad_Zima this is working fine for me. Make sure you are using the right ` sign.
Unfortunately, I'm using the stock data fields in an Orchestrator runbook and not a Powershell script, or are you saying this will work there as well?
In SCORCH right click the field and choose expand.
Layout your datapoints as you want them in the description field.
Yes, you can use PowerShell activities in your runbooks to update items, too.
Oh man, I had no idea the Expand option was there! I feel kind of dumb for not seeing it before. Only a half-hour into the work day and I've learned something new. Thanks guys!
I wanted to update anyone who might stumble across this in the future. When I wrote the post I was using a copy of @Adam_Dzyacky's Add-ActionLogEntry function which can be found in the SMLets Exchange connector script. There appears to be some weird conversion going on when passing a string with escaped chars to the function.
The solution was to use "`r`n" to create a newline when passing to the function. When using direct SMLets I believe @Peter_Miklian's example above should be sufficient.
Edit: I should specify this isn't the exact answer to the question I had at the time, but it is the second post that comes up when searching for the terms "Powershell newline" in the community so it seemed like a good place to put it.