New item indicator

Hi Everyone!
Looking for way to make an inidactor on the page that shows there is a new item.

For example a number symbol on the page…

See attachment

2 Likes

Hi Kim!

These are basically notifications.

Let’s say you want to be notified when there is a new Conversation.

First, you would create a Notifications object. Each Notification record connects with a Conversation and Account and has an “Unread” yes/no field. When a Conversation is created, we insert a connected Notification record. Then your Custom JavaScript would check periodically (every ~15 seconds) for unread Notifications connected to the signed-in Account, and shows that number in the navigation menu. When the logged-in Account marks a Notification as read, we update the Unread field in the Notification to “no.”

The tricky part is writing the JavaScript. You’ll need to write a “Polling” function:

Polling is a technique where we check for fresh data over a given interval by periodically making API requests to a server. For example, we can use polling if there is data that changes frequently or we need to wait for the server to transition a given state. Polling is a simple alternative to web sockets or server events. Source: Polling in JavaScript. A guide to building your own polling… | by Trey Huffine | Level Up Coding

You technically don’t need the polling function, but without it, users would need to refresh their page to update the notification icon, which is a poor user experience; I’m assuming you want to the notification icon to automatically update.

Hope this starts you on the right path.

I’ve built similar features in other apps before, feel free to get in touch.

Ian

4 Likes

thank you! Appreciate the guidance will give this a try :smiley:

1 Like