Next Experience Notifications TroubleshootingSummaryThis article is meant to assist people with troubleshooting Next Experience notifications. It is primarily intended to help users setup and troubleshoot in app notifications (Next Experience Notifications) not firing. What are Next Experience Notifications? Next Experience notifications are toast messages that are used to notify users when something happens within Glide. These notifications displayed as small pop-up messages on the user's screen as well as tuck away into the bell menu after a few seconds. They can be clicked by the user to navigate to a targeted record. The notification message can be customized but is limited to a small number of characters that fit in the toasts and bell menu.ReleaseNext Experience notifications are only available in `Next Experience` UI.InstructionsThere are 2 ways to setup notifications depending on what you are looking for. How to setup notifications? There are 2 ways to setup notifications depending on what you are looking for. `sys_notification` configuration - Easier to setup - Setup requires no script just config - Can setup title and message with a combination of static text and field values from the targeted record - There is configurations for setting a trigger based on changes to records in a targeted table or based on events that are fired2. Manually make notification with `ui_notification_inbox` record creation - More customizable notification content - Usually created from a custom business rule - Your script can determine what icon, title or message should be displayed Solution 1 (Setup via sys_notification) Create a `sys_notification` recordAfter this record is saved create a `Content` from the related list - click `New Provider Content` - click `Next Experience` - Add a `name` - You will have `Message heading` where you can specify a heading for the notifications and you can use variables from the record that triggered this notification - Same for `Message` field- In the `sys_notification` record make sure to fill in the `Who will receive` tab- Setup the `When to send` tab- Now when you trigger the action you set up in `When to send` the user you specified should get the notification with your custom message Solution 2 (Setup Notifications Using a Business Rule) You could use any glide script for this but for this example we will use a Business Rule. Lets make a notification on insert and updates on the `incident` table. We will notify the user that is specified in the `caller_id` field.- Create a `Business Rule` in the `sys_script` table - Name = `Test Incident Notification` - Advanced = `checked` - Active = `checked` - `When to run -> When` = `after` - `When to run -> (Insert & Update) checkbox's` = `checked` - Table = `incident` (That's what we use for the script below) - `Advanced -> Script` = Add something like the script below (function executeRule(current, previous) { // These fields will likely change depending on the table you use var assignedToUser = current.caller_id; var sysId = current.sys_id; var number = current.number; if (assignedToUser && sysId) { var now_GR = new GlideRecord("ui_notification_inbox"); now_GR.initialize(); now_GR.recipient = assignedToUser; now_GR.status = "new"; // For a list of icon names you can use see https://developer.servicenow.com/dev.do#!/reference/next-experience/vancouver/now-components/now-icon/gallery?currentPage=1&filter=he var payload = { message_icon: "heart-fill", message_type: "nextExperienceNotification", message_heading: "Custom Message", message: "This mesage is from " + number + " 😀!!!", }; now_GR.payload = JSON.stringify(payload); // Using Next Experience Notification Route now_GR.route = "bccd1214533201107cd3ddeeff7b1289"; now_GR.target = sysId; // This table should match the table the Business Rule is watching now_GR.target_table = "incident"; now_GR.triggered_by = "system"; now_GR.insert(); } })(current, previous); Make an update to an incident record- Impersonate the `user` that is a caller for the incident- See the notification in the users Bell menu Trouble Shooting Missing Notification This decision tree below should help you determine why you are not getting a notification. A If you go to the table ui_notification_inbox do you see the notification you expect the user to see in the list? The record would have your custom message in the payload field and a recipent of the user you expect to get the notification. B Does this notification get triggered by a sys_notification record? C We need to find out if the web browser is getting the notification live as it happens. Open tab 1 on the glide instance (Don't be on the record related to the notification you will receive).Open the chrome dev tools and open the Network tabRefresh the page so we get all the requestsSearch and open the amb request This request has the AMB (Websocket) connection and we can view the messages it is sending back and forth with the server Inside amb it will have it's own Messages tab. That we will look at in a minuteOpen Tab 2 in your browser and do that action that triggers the notificationBack at Tab 1 we are looking for a message in that amb message list It can take up to 10 seconds to show up with default settingsUnless there is something else taking up the background processing on the instanceThe messages have time stamps so it's easier to find messages that just happenedThere should be a message where you can unfold the nested output 0->data->record->payload in that payload you should see the message you expected to show up Did you see your notification message in here? A gotcha with this test If you are using the sys_notification method for creating notifications if the checkbox sys_notification->Who will receieve->Include the person whose action triggered the notification is not checked the above method wouldn't work. Alternatively instead of "Tab 2" you would open a incognito window and login as another user when doing the action that triggers the notification. D Check that the user has notifications enabled Click the user icon on the top rightClick Preferences->Notifications->General->Allow Notifications = Should be switched on Look at the sys_notification record you use to create the notification Check that the user logically should get the notification based on the Who will recieve tab If the user that is triggering the notification is the same as the one receiving it make sure that Include the person whose action triggered the notification is checkedMake sure the way you are triggering it follows the table and logic laid out in When to SendContent in the Related ListMake sure the related list Contents is a sys_notification_next_experience_content record. You can see this by clicking on the content and looking for that name in the url.If there was an error with the notification create most likely the Logs tab in the related list will have information about what went wrong Make sure the `sys_notificaiton` record has `content` (related list) Make sure the content has a `Message heading` Look at `System Logs` to see if there is an error about why a notification was not created. E You will have to debug the custom script that was used to create the notification. I can't really help with a customer script here but there is an example of triggering a notification programmatically in this document that you might want to reference. F Open the chrome dev tools and open the Network tabRefresh the page so we get all the requestsSearch for and open the amb request This request is the AMB (Websocket) connection and we can view the messages it is sending back and forth with the server One of the earlier messages to the server should have channel: "/meta/subscribe"When opening it you should also see a subscription that has ui_notification-inbox in the stringDo you see this? G The notification may not be seen if any of the following are true Currently on the record page that the notification would link toIf there is another amb message that came through with the same data->record->target->value (aka the notification goes to the same record when clicked) than it was considered a duplicate even if it came from another notification source This issue is on record and hopefully will be fixed in the future. PRB1722728 status on the ui_notificaiton_inbox record is deleted If non of the above are issues than Check the browser console for an error Couldn't build a notification. It was likely malformed or missing data. With this error you may want to compare your ui_notification_inbox record with one that works H Sys property glide.ui_notification.enabled should be true or not exist.You must be logged in as a user. If you are hopped in it is best to impersonate a real user. I Enable notifications should be enabled. Click on the User iconPreferences->Notifications->General->Allow Notifications = Enabled J This should usually not be an issue if you are using a sys_notification method to create notifications.Look at the ui_notification_inbox record. Does it have a payload?Is it valid JSON?Does it have these fields in the payload? message_iconmessage_typemessage_headingmessagemessage_type = nextExperienceNotificationRecipent should be the user you expect to get the notificationRoute should be Next Experience RouteTarget should be the record you go to when you click on the notificationTarget Table the table the Target belongs to Related LinksWhat versions does this work for? Xanadu and the previous two versions should support these steps. Future versions may also work, but no guarantees can be made.