How to make bold letters in body of the notification message.

Community Alums
Not applicable

Hi All,

In my first run script activity have a scratchpad variable(workflow.scratchpad.msgFinal) where i am storing a result. Please refer below

find_real_file.png

After this run script activity i have a notification activity where i am printing the scratch pad variable in body of the mail. And it should be look like below. Bold & Underline. I have used <b> tag and <u> tag in runscript. But am not getting bold and underline format. 

find_real_file.png

Is this can be achievable only by notification script? 

Regards,

Sirraj

1 ACCEPTED SOLUTION

yahh , tested it can be used, <b> and <u>  can be set using run script activity as well.

lets do one thing, would it be possible if you can break your string and hardcord some text and see if its setting correctly format or not. 

 

View solution in original post

19 REPLIES 19

Harsh Vardhan
Giga Patron

best way would be email script. try with email script that will work. 

Community Alums
Not applicable

Within run script it is not psbl? Because i am checking some 4 vcenter servers to delete snapshot by iterating one server one at a time. 

It would be easy if i do all the formatting operations in run script activity and i ca directly send scratchpad to notification

Regards,

Sirraj

 

Hi,

for formatting the text you need to use email script

Are you saying you want to send the formatted text from the run script while triggering event queue

You can send the formatted text via gs.eventQueue() in either parm1 or parm2 and then use that in email script

Can you share the script you are trying?

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Community Alums
Not applicable

Hi Ankur,

So the requirement is i need to delete snapshots in vmware vcenter server by orchestration. I have 4 servers. I will send one and get output and stored in (var result).

 

Please refer the comment part for better understanding.

var currentVcenter = workflow.scratchpad.vCenterName;
//Holds the current vcenter

var result = workflow.scratchpad.testoutput.returnValue;
//Hold the result of current vcenter

if (result.indexOf("There are no snapshots") == -1) {

workflow.scratchpad.msgFinal += "\n" + "\n" + "<b> <u> Snapshot Report For " + currentVcenter + "</u></b>\n" + "\n" + result;
} else {
for (var i = 0; i < result.length; i++) {
workflow.scratchpad.msgFinal += "\n" + "\n" + "<b> <u> Snapshot Report For " + currentVcenter + "</u></b> \n" + "\n" + result[i] + "\n";
}
}


workflow.scratchpad.counter++; //increasing my counter to feed V2

var loop;
var counter = workflow.scratchpad.counter;
var listSize = workflow.scratchpad.ablength;
if (counter < listSize) {
loop = true;
} else {

loop = false;
var value = workflow.scratchpad.msgFinal;
value = value.substring(9, value.length);
workflow.scratchpad.msgNotify = value; //Once all iterations done this wl holds result for all 4 vcenters
}
workflow.scratchpad.loop = loop;

 

*****************************************************

So now msgNotify has all my outputs to be printed in notification. Please refer below logs. If i send the below output (whole content) to mail script, how can i format.?