Saturday 10 March 2018

Processing Events from SharePoint Webhook Services

Let us theoretically look how the event changes are retrieved from the storage queues, processed and stored on to the logs like SharePoint history lists.

In the previous post, you have seen how to subscribe to the event changes on SharePoint online and how the events are stored on the storage queue. Here, you could see how the events stored can be processed.

Process Data from the Queue - Web Jobs


If we closely look in the previous post, SharePoint service has sent few details to the notification service when the event change had happened on SharePoint. In the details, you can only see what has changed at high level. That is, which list has changes. It doesn’t define, what are the changes.
Event Change Details
Event Change Details

Wednesday 7 March 2018

Working with SharePoint Events using Webhooks

Introduction


In this post, let us look in detail on webhooks functionality. At a high level, there are two independent steps to work with Webhooks.
  • Subscribing to the SharePoint events (remote events)
  • Processing Events.
Note: In the recent SharePoint Saturday Event at Chennai, I have explored on using Serverless Webhooks. For the benefits of larger audience, I am writing down as a technical post in detail with explanations.

Subscribing to the SharePoint Events


SharePoint by default provides the subscription mechanism for event changes. For now, only item level changes can be tracked, that on SharePoint online platform.

Tuesday 6 February 2018

Introduction to SharePoint Webhooks

What is Webhook?


Web hook is a general concept for http based events, which will provide remote event mechanisms.

Say for example, you have a built a custom application separately which has some specific product related content. Whenever there is a data change on the product repository, your data on the custom application should also be updated. For this scenario, will you be keep on checking the product repository for the changes? The answer should be No. Instead of your application keep on poll the product for changes, product should notify or push the changes to your application.

What is SharePoint Webhook?


Previously for working with event based processes, we were using the server side event receivers and remote events receivers. Such processes can be replaced with the webhooks.

Wednesday 17 January 2018

Search Results in SharePoint with PnP JavaScript Core Library

SharePoint search provides ways to access the search results using PnP JavaScript core library programming. This post explores the search results, paging option and also describes about the customized wrapper objects available for developers, with #PnPJScore programming.

PnP JS core library provides wrapper object with more customized search results data for developers. Like other programming models like REST API or JSOM, PnP JS core also provides the raw search results as RawSearchResults object. Additionally, PnP JS core also provides few other objects, which is customized for developers. These objects are customized, and retrieved from the RawSearchResults object, which in turn is part of the JSON result.

Search Results Object:


Notable objects are listed below.
  • PrimarySearchResults – This object gets the formatted results from the RawSearchResults object. That is, this object will contain the necessary search results data that can be processed or displayed. It contains the formatted results from the following path.      RawSearchResults.PrimaryQueryResult.RelevantResults.Table.Rows
  • RowCount – Number of rows retrieved during the search query.
  • TotalRows – Number of items available for search query.

Tuesday 9 January 2018

Building SharePoint Search Queries using PnP JavaScript Core Library

PnP JavaScript core library provides the interfaces required for building the queries for searching SharePoint content.

There are multiple ways of building the queries for PnP JS core search.
  • One way is to use the Search Query interface directly with necessary query parameters
  • The other way is to build the query using Search query builder syntax along with other query parameters.
  • The default way passing just the query text to the search method.

PnP JS core acts as a wrapper for the interacting with the SharePoint data over the object models or the REST APIs available. The samples or syntax explained below are compatible for JavaScript editors.