how can I display values(task numbers) in notification body

kotab
Tera Contributor

Hello 
i want to populate the sctask data on email notification body 
TASK number :
closed date :

work note: 
and i have one variable is  list collector if user select something  some value i need to put that value on notification body:

kotab_0-1742480917027.png

please refer above snap short based user selection need to populate on email body.

 

please help me on this requirement 

 

 

1 ACCEPTED SOLUTION

pratikjagtap
Giga Guru

Hi @kotab 

Add Content in Email Body: Use ServiceNow email scripting (${} placeholders) to pull task details dynamically.

 

<b>Task Number:</b> ${number} <br>
<b>Closed Date:</b> ${closed_at} <br>
<b>Work Notes:</b> ${activity.work_notes} <br><br>

<%
// Fetch the list collector variable value
var lcVar = current.variables.list_collector_variable_name;
if (lcVar) {
%>
<b>Selected Values:</b> ${current.variables.list_collector_variable_name} <br>
<% } %>

 

Exolanation:

${number} → Populates SCTASK number.
${closed_at} → Displays the closed date.
${activity.work_notes} → Shows the latest work notes.
current.variables.list_collector_variable_name → Retrieves the selected values from the list collector.

 

Mark helpful if this helps you

 

Regards,

Pratik

View solution in original post

8 REPLIES 8

Ankur Bawiskar
Tera Patron
Tera Patron

@kotab 

Notification is on which table? what did you configure? share some more details and screenshots

You can simply use email body or email script and print the list collector variable value

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

Yes i created notification on sc_req_item table. 
And also i tired via flow designer (sent email action) but i pull list collector sys_id's.

kotab_0-1742560338208.png

 

Notification created on Sc_req_item table. please help me with script ?

Hi Ankur 
i created notification on (sc_req_item) table 

kotab_0-1742563722059.png

Not working