Virtual Agent customized Dynamic Greeting
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2023 07:38 AM
Greetings, everyone,
As a logged in user, whenever I access my virtual assistant in the portal, I aim to extend a warm welcome and provide essential information. Specifically, I wish to display the current count of open incidents along with a link to the corresponding list view in the backend, as well as the count of open RITMs (Requested Items) with a redirect link based on the logged-in user.
To achieve this requirement, I have replicated the Out-of-the-Box (OOB) Dynamic Greeting Topic. However, I am currently facing a challenge in incorporating the two counts and their respective links.
Therefore, I kindly request guidance on how to insert the script into the "Script Action Utility" and how to retrieve its response in the subsequent "Script response" activity. Alternatively, if you have any other solution, I am open to suggestions.
Please let me know if there is any additional output required from my end to provide further details about the question.
Thank you in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2023 10:08 AM
Hi @Robin ,
Here's an example script for the Script Response activity:
var incidentCount = 0; // Retrieve the count of open incidents
var ritmCount = 0; // Retrieve the count of open RITMs
// Generate the links based on the logged-in user
var incidentLink = '/incident_list.do'; // Replace with the actual incident list URL
var ritmLink = '/ritm_list.do'; // Replace with the actual RITM list URL
var message = 'Welcome! You have ' + incidentCount + ' open incidents. ';
message += 'Click [here](' + incidentLink + ') to view the incident list. ';
message += 'You also have ' + ritmCount + ' open RITMs. ';
message += 'Click [here](' + ritmLink + ') to view the RITM list.';
return message; // Return the formatted response message
Thanks,
Ratnakar