The CreatorCon Call for Content is officially open! Get started here.

its sending all the additional comments new ones and previous too I only want to send the latest add

kiran kumar m1
Tera Contributor

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 ?

1 ACCEPTED SOLUTION

Abhay Kumar1
Giga Sage

@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:

https://docs.servicenow.com/bundle/washingtondc-platform-administration/page/administer/notification...

Hope this will help you.

View solution in original post

11 REPLIES 11

@kiran kumar m1 

you can't get latest comments directly

you can do this

1) use lookup record action before Send Email and get the record from sys_journal_field which is latest for this record and comments field

2) then use Output of this in Send Email action by selecting the Value field from Lookup Record action

AnkurBawiskar_0-1713510101495.png

 

AnkurBawiskar_1-1713510187683.png

 

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

Hi @Ankur Bawiskar  I have tried this but its not picking the latest comment its picking the first comment that we have added , if we add a new comment its sending the notificaton with the first comment not the latest

@kiran kumar m1 

did you add the correct sorting i.e. Z to A on created field

please share your screenshot of Lookup record

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

kirankumarm1_0-1713521620414.png

 

kirankumarm1_1-1713521646884.png

 

 

kirankumarm1_2-1713521674610.png

 

 

Can you generate the body using a script?

dgarad_0-1713510627829.png

 

 

If my answer finds you well, helpful, and related to the question asked. Please mark it as correct and helpful.

Thanks
dgarad