Skip to content
SharePoint EntwicklungSharePoint Lösungen & Produkte

SharePoint Library Notifications for Every New Entry

See how our SharePoint document management app surfaces new library entries, badges open tasks, and keeps REST queries lean with five-minute refreshes.

In our previous deep dive on the document management app, Search Functionality for SharePoint Document Management Application, we showed how we make navigating SharePoint libraries effortless. This time we focus on a favorite usability boost: automated notifications that highlight each new entry in a SharePoint library the moment it appears.

Highlighting New Entries Inside SharePoint Libraries

Our document management app aggregates every entry from the connected SharePoint libraries. One of those libraries tracks each user’s open tasks. To keep work from slipping through the cracks, a red badge inside the interface displays the number of outstanding items—no need to open the list or refresh the page.

Notification for new entries in a SharePoint library

Automatic Badge Refreshes

Whenever a task changes—because someone assigns a new item or completes an existing one—the notification updates itself on a fixed cadence. We rely on the JavaScript setInterval helper to trigger our data fetch every 300,000 milliseconds (five minutes), so users always see a current count.

JavaScript Interval for Badge Updates

private loadOpenTasksCount() {
  // First call without delay
  this.executeLoadOpenTasksCountCommand();

  // Check open tasks every five minutes
  this.interval = setInterval(this.executeLoadOpenTasksCountCommand, 300000);
}

Querying the List Entries

The badge uses a REST query against SharePoint. To keep it fast, we only select the Id field, filter for the signed-in user plus the desired task status, and return the number of matches to the interface.

REST Query with Filter Criteria

public static getOpenTasksCount(): Promise<number> {
  const service: SPRestService = SPServiceProvider.GetCurrentSPService();
  const selectQuery = 'Id';
  const filterQuery = `AssignedToId eq ${AppContext.currentUser.id} and Status eq 'In Progress'`;

  return service
    .getListItemsByFilter(AppContext.taskList, selectQuery, filterQuery)
    .then(items => (items && items.value ? items.value.length : 0));
}

Service Call into the SharePoint Library

public getListItemsByFilter(list: IList, selectQuery?: string, filterQuery?: string) {
  const restAPI = `${this.context.pageContext.web.absoluteUrl}/_api/web/Lists(guid'${list.Id}')/items?${
    selectQuery !== null && selectQuery !== undefined ? `$select=${selectQuery}` : ''
  }${
    filterQuery !== null && filterQuery !== undefined ? `&$filter=${filterQuery}` : ''
  }`;

  return this.context.spHttpClient
    .get(restAPI, SPHttpClient.configurations.v1)
    .then(response => response.json());
}

Takeaways

Visual notifications coupled with lean REST queries ensure SharePoint users understand their workload in seconds while the platform stays responsive. Every new entry is flagged immediately, and the five-minute refresh cadence keeps the badge trustworthy throughout the day.

  • Document management
  • JavaScript
  • SharePoint

Related articles

Smarter Event Booking 1.4.0: series, time slots,
Card view of Smarter Event Booking showing event images, a date badge and seat availability

Smarter Event Booking 1.4.0: series, time slots, carousel

The new version on Microsoft Marketplace: one form for every kind of date, time slots for vaccination days, a waiting list and a card row for your home page.

Read more
Collect Additional Event Registration Details at

Collect Additional Event Registration Details at Sign‑Up

Collect extra registration details at booking — companions, dietary needs, headcount — and store them in SharePoint so attendees can edit information later.

Read more
Best Way to Link SharePoint Wiki Pages in Navigation

Best Way to Link SharePoint Wiki Pages in Navigation

Use Smarter Navigation to build a hierarchy of SharePoint wiki pages. Link pages in navigation and add via drag and drop on team and communication sites.

Read more

Questions about this topic?

We are happy to help you put this into practice in your environment.