- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-18-2024 10:42 PM
I have created a flow , whenever we change the additional comments it should send a mail to the caller mail with those additional comments , but whenever I update the additional comments , its sending all the additional comments new ones and previous too I only want to send the latest additional comments though mail, I am thinking of writing script but in email body I dont find any way to write script ? How can we achieve this ?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-18-2024 11:03 PM
@kiran kumar m1 you will have specify like ${comments:1},
please follow below servicneow document for more details scroll down to go line whether explain about comment variable to be used for any number of comment:
Hope this will help you.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-19-2024 12:12 AM
Hi Kiran
@dgarad has given you good advice.
You can use getJournalEntry(1) to return the first comment only.
Because you are trying to trigger an email based on an update to the comments, you should set this up with an email notification.
Set the trigger to when 'additional comments = changes' and in the mail notification, you can insert a mail script that prints the comment by looking up the record and using the above.
let me know if you need more information.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-19-2024 01:03 AM
@kiran kumar m1 Yes you can create an email script let's say a name 'getLastComment' with below script
var cmt=current.comments.getJournalEntry(1);
template.print(cmt);
And in email template use below:
${mail_script:cmt}
Hope this should work for you.