Understanding VA greeting message script

Ryax
Tera Expert

Hi,

It is worth starting off by saying I'm new to VA - I'm trying to understand where "getGreetingMessage" is defined in the below script from the OOB personalized greetings message. As I understand it "getGreetingMessage" must be defined somewhere and it is then passed to the {1} result in the below code which then causes it to appear in the chat bot window. I'd like to understand where it is defined so that I can go in and amend the wording slightly. I understand I could remove it from the below and manually input text however I would prefer to understand how the below is working so I can learn from it.

var result;
if (vaInputs.user.first_name.getDisplayValue()) {
return gs.getMessageLang('Hi {0}, {1}', vaContext.getRequesterLang(), [vaInputs.user.first_name.getDisplayValue(), vaSystem.getGreetingMessage()]);
 
Many thanks
 
Richard
1 ACCEPTED SOLUTION

Mark Roethof
Tera Patron
Tera Patron

Hi there,

The getGreetingMessage is just a vaSystem property. In this case, it's using the UI Messages. See below example.

If you would like to change this message, just update the UI Message with Key "Hi, I'm your Virtual Agent. Let me know how I can help you today." > Message field.

find_real_file.png

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP

---

LinkedIn
Community article list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

View solution in original post

9 REPLIES 9

Mark Roethof
Tera Patron
Tera Patron

Hi there,

The getGreetingMessage is just a vaSystem property. In this case, it's using the UI Messages. See below example.

If you would like to change this message, just update the UI Message with Key "Hi, I'm your Virtual Agent. Let me know how I can help you today." > Message field.

find_real_file.png

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP

---

LinkedIn
Community article list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Hi Mark,

 

Thank you so much that's exactly what I was after! 😄

 

Rich

Hi Mark, 

 

I inherited a slack integration, and when I execute the same topic in both the service portal and in slack, it appears that vaSystem.getTopicSelectionMessage() gets different results.

 

In the slack client - it gets a sys_property = com.glide.cs.topic_picker_msg

In the service portal (and topic test button)  = it uses the Message table as you pointed out. 

 

Why does this happen? What is the logic in this function: vaSystem.getTopicSelectionMessage()?

 

Thanks. 

-Jeff

I have edited the message still its showing previous one