Badge count for chrome_toolbar workspace side menu

JiriN
Tera Contributor

Hello ServiceNow Community,
I'm currently developing a custom notifications page within UI Builder and have encountered a challenge regarding the workspace sidebar (specifically, the `chrome_toolbar`). My goal is to display a dynamic badge count next to the workspace side menu icon, reflecting the number of notifications present on my custom page. I've observed the presence of a `"badge"` key within the `chrome_toolbar` JSON structure. While I can successfully display a static value by directly assigning it, for example, `"count" : "3"`, this doesn't meet my requirement for a dynamic count. Ideally, I need a mechanism to update this badge value dynamically based on the real-time number of notifications displayed on the UI Builder page. I suspect this might involve manipulating a client state parameter and binding it to the `"badge"` value in the `chrome_toolbar` configuration. Has anyone successfully implemented a dynamic badge count on the workspace sidebar in UI Builder? If so, could you please provide guidance or insights on how to achieve this? Specifically, I'm interested in:

{
        "id": "notifications",
        "label": {
            "translatable": true,
            "message": "Notifications"
        },
        "icon": "bell-outline",
        "routeInfo": {
            "route": "notifications"
        },
        "group": "top",
        "order": 300,
        "badge": {},
        "presence": {},
        "availability": {},
        "viewportInfo": {}
    }

JiriN_1-1744636571193.png

 

#uibuilder #nextexperience

1 REPLY 1

Chaya Kramer
Tera Contributor

Hello,

Did you find any solution for this?