Retrieve latest public comment in flow designer data pill.

Victor Ruiz
Tera Guru

The below data pill retrieves all the public comments from the record, can it be setup to only retrieve the latest comment?

 

find_real_file.png

 

 

5 REPLIES 5

///Can you check the log for source @@@TESTING

var gr = new GlideRecord(fd_data.trigger.current.getTableName());
gr.get(fd_data.trigger.current.getValue('sys_id'));
var all_comments = gr.comments.getJournalEntry(-1);
var latest_comment = gr.comments.getJournalEntry(1);
gs.log('all_comments = ' + all_comments + ' latest_comment = ' + latest_comment, '@@@TESTING')
return latest_comment;
Please mark Correct and click the Thumb up if my answer helps you resolve your issue. Thanks!
Vinod Kumar Kachineni
Community Rising Star 2022