- 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 03:30 AM
What is your business requirement here?
What message do you want to display and what do you mean by condition based?
Regards,
Sumanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2025 03:51 AM
Requirement is like example I want to display message like "This is lunch time " and it should display in VA Bot between current time 1 PM to 2PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2025 04:16 AM
Hi @Pooja P,
I believe that you must go to "Presence states":
And create there a new state that meets your requirements:
Something as seen below, just Available to receive work item: false
Let me know how did you managed this.
/* 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-15-2025 04:18 AM
@Pooja P the above will add new state here:
If you want to add a message in Virtual agent, you need to create a new topic with the corresponding logics - condition on time and return the sentence.
/* If my response wasn’t a total disaster ↙️ ⭐ drop a Kudos or Accept as Solution ✅ ↘️ Cheers! */