- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2025 02:57 AM
Hi team,
We have a requirement to display message during lunch time only in Virtual agent. Can someone suggest on condition based message display in VA.
Thanks in Advance!
Pooja
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2025 06:18 AM - edited 07-17-2025 06:25 AM
@Pooja P Follow below steps
1) Go to "Designer" under Virtual agent. Search for "Greetings." setup topic
2) Duplicate this setup topics and save it as "Custom Greeting".
3) In custom greeting record, click on "Show Greeting Message" record & open the scripted response message as show below
4) Replace code in response message with below code
(function execute() {
var message = '';
var localDateTime = new GlideDateTime().getDisplayValue();
var getTime = localDateTime.toString().split(' ')[1];
var getHour = parseInt(getTime.toString().split(':')[0]);
if (getHour >= 13 && getHour <= 14)
message = "Hi there! I'm your Virtual Agent. It’s lunchtime, go ahead and treat yourself to a delicious break! If you’ve already had your lunch, feel free to tell me how I can assist you next."
else
message = "Hi, I'm your Virtual Agent. Let me know how I can help you today."
return message;
})()
5) Click on save & publish. While publishing it shows any error of NLU model mapping. Then remove NLU model and Associated intent value from properties section.
6) Go to "Settings" module under "Conversational Interfaces" application. Select "virtual agent", then click on "view all" on "Custom greeting and setup" record.
Open the "Default chat experience" record & go to "Setup Topics" section. Replace "Greeting." with "Custom Greeting " in setup topic column. Click on update
6) Check in VA if the new response message is showing or not using lunch time
If I could help you with your Query then, please hit the Thumb Icon and mark as Correct !!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2025 10:57 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2025 11:19 PM
@Pooja P and do you want to be there always or as response when somebody starts conversation?
/* If my response wasn’t a total disaster ↙️ ⭐ drop a Kudos or Accept as Solution ✅ ↘️ Cheers! */
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2025 05:14 AM - edited 07-16-2025 05:14 AM
Hi @GlideFather
It would be helpful if we have for both the ways.
or more prominently if someone starts the conversation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2025 05:34 AM
OK, it shall be doable. Not tested, by try to find the topic with your standard greeting and add there scripted condition for a decision - if it is within the lunch break period, it will return message1 and if it is outside of that time slot, it will return message2
/* If my response wasn’t a total disaster ↙️ ⭐ drop a Kudos or Accept as Solution ✅ ↘️ Cheers! */
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2025 06:18 AM - edited 07-17-2025 06:25 AM
@Pooja P Follow below steps
1) Go to "Designer" under Virtual agent. Search for "Greetings." setup topic
2) Duplicate this setup topics and save it as "Custom Greeting".
3) In custom greeting record, click on "Show Greeting Message" record & open the scripted response message as show below
4) Replace code in response message with below code
(function execute() {
var message = '';
var localDateTime = new GlideDateTime().getDisplayValue();
var getTime = localDateTime.toString().split(' ')[1];
var getHour = parseInt(getTime.toString().split(':')[0]);
if (getHour >= 13 && getHour <= 14)
message = "Hi there! I'm your Virtual Agent. It’s lunchtime, go ahead and treat yourself to a delicious break! If you’ve already had your lunch, feel free to tell me how I can assist you next."
else
message = "Hi, I'm your Virtual Agent. Let me know how I can help you today."
return message;
})()
5) Click on save & publish. While publishing it shows any error of NLU model mapping. Then remove NLU model and Associated intent value from properties section.
6) Go to "Settings" module under "Conversational Interfaces" application. Select "virtual agent", then click on "view all" on "Custom greeting and setup" record.
Open the "Default chat experience" record & go to "Setup Topics" section. Replace "Greeting." with "Custom Greeting " in setup topic column. Click on update
6) Check in VA if the new response message is showing or not using lunch time
If I could help you with your Query then, please hit the Thumb Icon and mark as Correct !!