Pending surveys link pop up when user logs in to service portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2024 01:15 AM
Hi All,
Below is the requirement where I need some help.
When any user logs in to the Service portal, a popup should come up stating that you havepending surveys. Please attempt the surveys before they expire.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2024 07:50 AM
Hello @Bhagya
This could be possible in various ways like clinet script,ui script.
With the below onload uiscript you can try to implement first in your dev or anyother lower env.
var currentUser = gs.getUser();
var grSurveys = new GlideRecord('sn_survey_definition');
grSurveys.addQuery('active', true);
grSurveys.addQuery('state', 'open');
grSurveys.addQuery('assigned_to', currentUser);
grSurveys.query();
if (grSurveys.next()) {
// popup message
var message = "You have pending surveys! Please attempt them before they expire: <br>";
while (grSurveys.next())
{
message += "<a href='" + grSurveys.getDisplayURL() + "'>" + grSurveys.getValue('name') + "</a><br>";
}
// Show the popup using GlideDialog
GlideDialog.show("Survey Reminder", message);
}
if my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,
CB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2024 06:19 PM
I needed the functionality for the service portal. When the user login to the portal then the pop up should come