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.

Thursday 28 December 2017

Working with SharePoint Site Permissions using PnP JavaScript Core Library

Here let us look at the working with SharePoint site permissions using the PnP JavaScript library. Some of the basic operations like retrieve available permissions, add or remove the user permissions from the site will be explained.

Note: 
  • PnP JavaScript Core Library is supported on SharePoint 2013, SharePoint 2016 and SharePoint Online versions.
  • The prerequisites for the operations are es6-promise.jsfetch.js, pnp.js or pnp.min.js.

The following sample shows us retrieving all user permissions of the SharePoint site along with the user roles using PnP JavaScript Core library.



Saturday 9 December 2017

Azure Active Directory App Authentications

Azure AD App registrations provides ways for authenticating or authorizing the user custom applications which uses Azure AD, to access the data available on the Microsoft products/services.

Why Azure AD App Registration? You might have already worked with custom applications that uses Azure Control Service, which provides way for authenticating users to gain access to web applications and services. As ACS is getting deprecated, Microsoft provides ways for authenticating the applications and provides way for enabling permissions for users to access the data. 

(Source: https://cloudblogs.microsoft.com/enterprisemobility/2013/06/22/azure-active-directory-is-the-future-of-acs/)

Monday 20 November 2017

Working with Calendar events from Office 365

In this article post, let us look at the way of accessing the Office 365 calendar events programmatically using REST APIs.

In the samples shown, calendar events will be accessed from SharePoint portal pages using two ways. One way is to use the graph API and the other way is using the outlook API.


Outlook API vs Microsoft Graph API:


Outlook API has lot of API end points to access the mailbox data in office 365 or other Microsoft mailbox services. It has around 11 API subsets for accessing various components under outlook like calendar, contacts, etc.

Microsoft Graph API, helps getting connected to multiple Microsoft products or services. The services include outlook, teams, SharePoint, people etc. This also helps in accessing other user information as well.