in javascript can we use html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
In notifications I've configured for team actionable notification. SO IN LINKN TO CONTENT I'VE written javascript to show the variables i wanted to show in tabular format. So how to use html in that script . i used table,tr,td tags not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
please share where have you written this?
share screenshots
💡 If my response helped, please mark it as correct ✔️ and close the thread 🔒 — this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
script used in notification in link to content tab
(function getNotificationHeadingAndMessage(
target,
event,
recipientTable,
recipientSysId,
vaNotificationRuntimeContext) {
var approval_record = new GlideRecord("sysapproval_approver");
approval_record.get(target.sys_id);
var requested_item_record = approval_record.sysapproval.getRefRecord();
var ritm_sysid = requested_item_record.sys_id;
var ritm_number = requested_item_record.number;
var gr = new GlideRecord("sc_req_item");
gr.get(ritm_sysid);
var item = gr.cat_item.name;
var messageHeading = [ritm_number, item];
var messageContent = gs.getMessage("This requested item needs your review.");
var variablesDetails = "";
var variables = gr.variables.getElements();
for (var i = 0; i < variables.length; i++) {
var question = variables[i].getQuestion();
variablesDetails += "**" + question.getLabel() + "**: " + question.getDisplayValue() + "\n\n";
}
messageContent += "\n\n" + variablesDetails;
return {
messageHeading: messageHeading.join(" - "),
messageContent: messageContent
};
})(target, event, recipientTable, recipientSysId, vaNotificationRuntimeContext);
this script returns variable and answers i want to show them in a tabular format
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
screenshots please, where have you written this script
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
