Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to add Latest comments in virtual agent

SS1510
Tera Contributor

I have a requirement to add Latest comments on incident on Virtual Agent Card,  I have to show short description, state and latest comments. When i am adding the comments field on card latest 3 comments are showing , i want to show only 1 latest comment, how can i achieve this?

SS1510_0-1762161250852.png

 

1 REPLY 1

GlideFather
Tera Patron

Hi @SS1510,

 

you can use the query to that particular incident, check their comments, sort it by created on and use setLimit( 1 ), that will give you the latest comment.

 

Can you share some more of your configurations? The branches you have there seem to select INC, RITM and some Case (HR or CSM?), but how do you do to select a desired record in each of the branches?

_____
0 % AI and 100 % GlideFather. Disaster may appear. Deal with it!