# New item indicator

**URL:** <https://forums.knack.com/t/new-item-indicator/12978>\
**Category:** API & Custom Code\
**Created:** [August 26, 2022, 3:55pm UTC](https://forums.knack.com/t/new-item-indicator/12978 "2022-08-26T15:55:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![KimDion38026](https://avatars.discourse-cdn.com/v4/letter/k/9f8e36/32.png) [@KimDion38026](https://forums.knack.com/u/KimDion38026)\
**Post date:** [August 26, 2022, 3:55pm UTC](https://forums.knack.com/t/new-item-indicator/12978/1 "2022-08-26T15:55:50Z")

</div>

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

 ![Screen Shot 2022-08-23 at 2.55.22 PM](https://us1.discourse-cdn.com/flex020/uploads/knack/original/2X/1/13c719fac82a2c2d8ab348efddeb4428e87fb445.jpeg)

---

<div class="post-metadata">

**Author:** ![KnackPros](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.knack.com/knackpros/32/807_2.png) [@KnackPros](https://forums.knack.com/u/KnackPros)\
**Post date:** [August 26, 2022, 5:28pm UTC](https://forums.knack.com/t/new-item-indicator/12978/2 "2022-08-26T17:28:40Z")

</div>

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](https://levelup.gitconnected.com/polling-in-javascript-ab2d6378705a)

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](https://knackpros.com).

Ian

---

<div class="post-metadata">

**Author:** ![KimDion38026](https://avatars.discourse-cdn.com/v4/letter/k/9f8e36/32.png) [@KimDion38026](https://forums.knack.com/u/KimDion38026)\
**Post date:** [August 26, 2022, 5:57pm UTC](https://forums.knack.com/t/new-item-indicator/12978/3 "2022-08-26T17:57:45Z")

</div>

thank you! Appreciate the guidance will give this a try 😃
