2

Is it possible to notify users when new content is added to a SharePoint List? I need to do it programmatically. For example, a notification in the top left corner stating "You have new content added.". Once the content is stored in the SharePoint List, users will then be notified when they visit the homepage.

I have created a SharePoint List named UsersNotification with two columns, a ContentID column and a UserID column. Whenever a current user clicks on "View content" in a particular page in my site, the ContentID and UserID will be stored in the UsersNotification list. This will check if the user has viewed the new content or not. If the user hasn’t viewd the new content, then a notification will be displayed as mentioned above. If the user has viewed the new content, then no notification will be displayed

As of now, I have both IDs, but how can I notify the users?

0

If you already have the notification information in a list you can use server-side programming to display this information in your site (e. g. adding a web part, user control, etc.).

My personal choice however would be adding some client-side javascript code making an asynchronous call with REST querying if their are new items for the current user in your list.

As a parameter the call could receive the current User Id (_spPageContextinfo.userId) and whatever filters you would like to apply. In the response from the REST call (and assuming new items are available) you could easily inject some HTML into the DOM of the page header to notify the user (for this part js libraries like jQuery are your friend).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.