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

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

very helpful pratik...keep helping the community.

Hello pratik 

 

every thing populated expect work note 
Thank you 

Mark Manders
Mega Patron

What table is the notification on? You can just add ${number} and it will show you the number.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark