Monday 27 August 2018

Provisioning Layout and Static Content for Office 365 SharePoint Wiki Pages Using PnP PowerShell

Here let us look how to add text to the wiki pages using text layouts with predefined text. In the samples, let us use PnP PowerShell scripts to create a wiki page, apply default layout and for adding content.

Problem Statement: Programmatically creating or updating wiki pages which uses OOB wiki page layouts with some predefined text. This is easily possible with manual actions. While creating a page using client side scripts, adding content to the page is not feasible. So, let us look how to add the text to the created wiki pages programmatically using PnP PowerShell scripts.


Applying Wiki Page Layouts with Content


The following are the points to be considered for adding text to wiki pages.
  • Create a Wiki Page (This is required if the page doesn’t exist already)
  • Retrieve the wiki page to be updated – Using CAML query to get the required page list item.
  • Apply text layout with predefined text to a retrieved wiki page.
Before getting into operations, let us connect to the SharePoint site using PnP PowerShell using the following snippet.

Create a wiki page: Let us programmatically add a page to a SharePoint site using PnP PowerShell script. The following snippet creates a page with the required layout.
Note: Skip the above step if wiki page is already created.

Tuesday 14 August 2018

Creating Page Layouts with Rich HTML Field Editors on Office 365 SharePoint

You would have seen several articles for creating page layouts with custom content types. But in this article let us look how to provision page layouts with multiple rich text fields.

Problem Statement: OOB publishing HTML field (Rich Field Text Column) can be used to create the content type for page layouts manually. But if you require more than one Rich Field Text Column, then we need to create those publishing HTML field programmatically.


Create Page Layout with Rich HTML Fields:


The following are the points to be considered while creating page layouts.
  • Create Site Columns
  • Create Site Content type
  • Add Site Columns to the Content type
  • Create Page Layout using the Content type.
Since few properties needs to enabled on a field, this is only possible with programming way. The field XML is built and then the field is created using the field XML.

This approach might be possible in multiple programming ways including PowerShell, CSOM PowerShell, CSOM, JSOM or REST API. But in the samples below, let us use PnP PowerShell for provisioning required components.

Wednesday 1 August 2018

Customize People Picker Columns on Office 365 SharePoint Lists using OOB Column Formatting

Microsoft enables developers to format the SharePoint columns using JSON on the OOB list views. It is achieved using column formatting feature, which is available on the Office 365 SharePoint modern sites so far. The way the fields are displayed can be changed with the help of column formatting.

Column formatting helps in rendering the fields with customized view and style. There is no complex customization or coding involved in applying the column formatting.

In this scenario, let us look customizing the SharePoint user field column, available on a list. By default, user names will be displayed with hyperlinks on the SharePoint list views. The hyperlinks will lead to the user profiles. For example, we will hide the default user hyperlink text and show the picture of user along with user name using column formatting.

This customization is only possible with modern views of SharePoint list. Current view of the list will be,
SharePoint Modern List View
SharePoint Modern List View

Tuesday 24 July 2018

Protecting Office 365 SharePoint Data on Microsoft Flow

Here, let us look how we can protect the Office 365 SharePoint application data on Microsoft Flow.

Microsoft Flow is used for connecting multiple services and applications. The data flows between multiple platforms, with the help of Microsoft Flow.

Imagine there are business critical data available on SharePoint and your organization doesn’t let data to move out of its controlled systems. As administrator, you can build environments and restrict the data flow with the help of Data Loss Prevention (DLP) policies.

DLP policies are created to restrict the data flow between business connectors and non-business connectors. The restrictions are made with help of data groups. The Data groups are of two types, Business data only and No business data allowed. The connectors can be added to these two data groups.

If you don’t want data to be available on social media platforms like Facebook or twitter, you can keep the social media connectors on “No business data allowed” group. The restriction cannot be made just for social media connectors; it can be applicable to any connector, if the connector is not listed under “Business data only” data group.

Friday 6 July 2018

Analyze and Classify Images on Office 365 SharePoint using MS Flow and Azure Service

Let us see how the Office 365 SharePoint library images are analyzed using Microsoft Flow and Azure Cognitive Service. By analyzing the images, we can classify the images. Also, we can extract the image description, tags or taxonomy data of image, locations present on images, or even the image categories.

Azure Cognitive service provides Computer Vision API, which helps providing tools to understand the content of any images. Computer vision API helps in classifying the image, identifying captions of image and even image categorizations. Further API helps in recognizing celebrities and landmarks, reading out text from images, analyzing video in real time and generating thumbnails for the videos.

Computer vision API can be leveraged on multiple platforms. Microsoft Flow is one such powerful platform, where we integrate computer vision API for analyzing the images uploaded to SharePoint.

Use Case: Let us see how the images uploaded can be analyzed classified on SharePoint images library. At the end of article, you will know how the below image uploaded can be updated classification and description data.