Showing posts with label SharePoint. Show all posts
Showing posts with label SharePoint. Show all posts

Saturday 22 December 2018

Working with Office365 Project Online Tasks using JSOM - Part I

This article series focuses on working with office 365 project online plan schedule tasks using JSOM approach. The operations like create, retrieve, update or delete project task operations are explained.

Here in this article, let us look at creating or retrieving project schedule tasks using JSOM approach. 

Office 365 Microsoft Project Online helps creating project plans, managing schedules and collaborating with other resources virtually. Project plans, task schedules and other objects on the Microsoft Project online can be accessed or created or updated programmatically. Microsoft documentation site  provides REST endpoints for working with project online objects. 


Load prerequisite files and context: 


To get the project server context working, first let us see the prerequisite files to be loaded for getting the project online contexts. The following piece of code shows how the required Project Server/SharePoint files and contexts (PS/SP) are loaded. 


Monday 10 December 2018

Accessing Office 365 Project Web App Objects using REST API

This article describes accessing the objects present on the Office 365 project web app site collection using REST API.

PWA abbreviated as Project Web App, is available on Office 365, and it used for easily and efficiently planning projects, track status, and collaborate with other virtually. It is an application built on top of SharePoint, which has collaborating features. Any PWA site collection will have the project web app settings feature enabled on the site collection. To know more about PWA, refer to the official documentation available on the MSDN site.

Let us see the high level REST API (service end points), which can be used for accessing objects available on Office 365 PWA site collections.

Note: Replace the Office 365 PWA url with your respective URL.

To access the project server and list of available objects,
https://nakkeerann.sharepoint.com/sites/pwa/_api/ProjectServer

The REST APIs used for accessing objects available on the project servers are explained below.


Custom Fields:

The enterprise custom fields are created on the project plans for managing additional project attributes. The custom field can be at project or task level. The following API is used to access all the enterprise custom fields.
https://nakkeerann.sharepoint.com/sites/pwa/_api/ProjectServer/CustomFields

One specific field can be accessed using the field GUID:
https://nakkeerann.sharepoint.com/sites/pwa/_api/ProjectServer/CustomFields('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx')

Wednesday 28 November 2018

Serverless Azure WebJobs - Triggers to Push Data from Azure Storage into Office 365 SharePoint

Let us look how we can leverage the power of azure cloud storage, and integrate data into Office 365 SharePoint. In this article, we will use serverless WebJobs to push the data into Office 365 SharePoint online, whenever new content is added to storage systems like queues and blobs.

Scenario: Azure cloud storage system is used as centralized platform for storing/publishing the content. Office 365 SharePoint to get the content, whenever the data is available on the cloud storage.

Azure webjobs can be used for pushing the data to SharePoint systems/applications. We will be using Azure Webjob SDK framework, which has necessary triggers for queues and blobs, to trigger the content whenever it is available. We will be using OfficeDevPnp core libraries on Azure webjobs to integrate the data into Office 365 SharePoint.

This article explains trigger events for both queue and blob, present on Azure storage. But based on your requirement, you can select any of the storage.

The prerequisites required are,
  • Office 365 SharePoint
  • Azure Storage Account –  
    • Queues 
    • Blobs 
  • Azure App Service which has WebJobs 
  • Microsoft Visual Studio – This is optional, and you can use any other alternative approach. But in this case, I have used visual studio to build the solution and to deploy the solution directly to cloud. 

Friday 9 November 2018

Azure Functions with Office 365 SharePoint Calls - Creating, Debugging & Deploying NodeJS Functions using Visual Code - Part II

Here let us look at the debugging the azure function locally and deploying the function to the portal.

In the previous article, we have seen creating the Azure function and accessing the SharePoint data using NodeJS.

Since we are calling SharePoint authentication methods and SharePoint list APIs, we need to make sure that the function is not returning the response to client, before executing the authentication and rest API calls. This can be done using async and await keywords. By default, outer module function has the async function. In the azure function code, we need to append the await keyword for the calling code and async to the function present in the code.

async and await on the azure function code
async and await on the azure function code

Note:
The code available in the previous article doesnt have these keywords, i have left it to you for embedding for hands-on.

Thursday 1 November 2018

Azure Functions with Office 365 SharePoint Calls - Creating, Debugging & Deploying NodeJS Functions using Visual Code - Part I

Let us have a detailed look at creating azure functions using visual code, creating sharepoint context for getting site data, debugging locally using visual code, and deploying the code to Azure function app from visual code.


Creating Azure Function using Visual Code:


Setup and install the prerequisites for developing azure functions using visual code.
  • Install the visual code on your machine and install all prerequisites required for developing azure functions.
  • Install the latest of NodeJS.
  • Then install the core tools package required for working with Azure functions. 
npm install -g azure-functions-core-tools
The extensions being enabled on the visual studio can be found in the following snapshot.

Thursday 11 October 2018

Using Azure Functions, Cognitive Services and Flow for classifying Office 365 SharePoint Word Documents - Part II

Let us look how to integrate Azure Function, Cognitive services into Microsoft Flow for extracting tags/categories and update the SharePoint document item.

This article series helps us to work on a special use case of extracting information of word documents uploaded to Office 365 SharePoint libraries and then analyze/classify the document content using Azure Cognitive Services. Then update the document with classified data as tags/categories. The article links are shown below.


Extract Code From Github


The Azure function created in the previous article is available on Github repository (https://github.com/nakkeerann/analyze-sp-word-documents).
  • Clone the code from the github repository to the local. 
  • Open in visual studio and make necessary changes, like updating user credentials and SharePoint site and details.

Saturday 6 October 2018

Using Azure Functions, Cognitive Services and Flow for classifying Office 365 SharePoint Word Documents - Part I

This article series helps us to work on a special use case of extracting information of word documents uploaded to Office 365 SharePoint libraries and then analyze the document content using Azure Cognitive Services.

We have seen before extracting tags and metadata properties of image files from Office 365 SharePoint using Microsoft Flow and Azure Cognitive Services.

Microsoft Flow has a Get File content action, but that doesn't help extracting word documents content. Only it supports extracting content of notepad as straight forward approach. Since Microsoft Flow doesnt provide any option to read the word documents content, we will be using Azure Functions to extract the content. Once we have the content, we will use Azure Cognitive service to get the tags for the content extracted. Here Microsoft Flow is used to manipulate triggers and subsequent actions. So our algorithm is will be as follows.

High level architecture for classifying SharePoint Word Documents

Saturday 22 September 2018

Connecting Office 365 SharePoint with CDS using Microsoft Flow

How many of you have heard about CDM and CDS? These two components are availabe on Microsoft platform. CDM stands for Common Data Model and CDS is Common Data Service.

CDM is a secured database stored on Microsoft Azure, which contains business standard entities. Those entities can be used by users for various purposes including integrations. This is commonly used for integrating two Microsoft Systems, with the help of templates/entities.

CDS is a basically a service, that utilizes common data model to enable cross platform reporting capabilities. It is most commonly used on Power BIs for report generations.


Scenario

Think of a scenario, where some application uses common data service for storing the data. And some application uses Office 365 SharePoint as the storage point. And both of these applications deals with the same data sets. In this case, both of these storage system needs to be synchronized.

The solution which we are looking at may not be a full end to end solution, but let’s see how we can push data from SharePoint to CDS. There might be many ways, but here let’s look how it can be done easily using Microsoft Flow with just configurations.

Wednesday 12 September 2018

Error Handling for Office 365 SharePoint Actions on Microsoft Flow

In this post, let us look how we are going to handle the Office 365 SharePoint action errors that occurs on Microsoft Flow platform.

Problem Statement: There is an option to get the user profile property on Microsoft Flow using SharePoint REST API. We need to handle if there is any error to this action. Let us see how to handle/catch the error and send a mail with error details.

Sometime back I have published an article for updating user display names for items created on SharePoint using Microsoft Flow. We will use the same concept here, but only we will see how to catch and send the error details over mail.

The flow to get and update the user profile property is as follows.
  • Create a trigger to fire the flow whenever an item is created.
  • Create a SharePoint action “Send an HTTP request to SharePoint”, to get the user profile property details as explained in the article mentioned above.
  • Parse JSON data to get the exact required property (user display name).
  • Update the same item with author name field with the value retrieved.


Handling Error:


The following steps shows how to configure the flow to handle the error and configuring appropriate send email action.
  • Just after the “Send an HTTP request to SharePoint” action, add a parallel branch with an action. 

Friday 7 September 2018

SharePoint Saturday Bangalore Event - Automating SharePoint Processes with Microsoft Flow

SharePoint Saturday Bangalore 2018 is a free and open SharePoint community event to exchange the knowledge and build fellowship.

Developer Track Session at a SharePoint Saturday Bangalore 2018 Event - Automating SharePoint Processes with Microsoft Flow! It was an extended interactive session where the benefits of using MS Flow for SharePoint explained with live demos.

I spoke on Automating SharePoint Processes with Microsoft Flow in a short session. The session was a developer track session, which had lot of tips, and demos. The agenda included,
  • Introduction to Flow
  • Templates and Connectors Available
  • How to create custom connectors
  • How to create and integrate flows with SharePoint or other systems
  • Data Loss Prevention Policies
  • Benefits & Conclusion

Microsoft Flow is a cloud based tool that helps building automated workflows between multiple systems. In the session, I will be explaining the basic understanding on MS FLOW. Further, I will focus more creating the custom connectors, and let us also look at creating flows with the help of custom connectors.

https://www.slideshare.net/NakkeeranNatarajan/automating-sharepoint-processes-with-microsoft-flow-spsbangalore

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.

Monday 25 June 2018

Making Office 365 SharePoint REST API calls on Microsoft Flow

In this post, let us look how we can work with the SharePoint data using the REST APIs explicitly in the Microsoft Flow. We will be using this approach when no action/connector are available OOB for processing the required SharePoint data on the MS Flow. Person who have knowledge on the APIs used will prefer to use this approach.

In my previous post, we have built the connectors/actions using the REST APIs. The objective of my previous post, was to show how any connector/action can be created and published on the portal. Such actions can be shared with other users and it is readily available as OOB actions for other/end users. Connectors/Actions will be created by developers and the business users will use such connectors on their flows.

At the end, both the approaches yield the same results. Both the approaches will be used only when no connector is available for users to work with the required data. Hope the above explanation differentiates two approaches available for working with the SharePoint data.

Let us look how we can retrieve the required SharePoint data using the REST APIs available. We can use the OOB action “Send an HTTP request to SharePoint”. This action supports any type (GET, PUT, POST, PATCH or DELETE) of service calls. In the sample below, let us only look at the GET operation.

Use Case: Retrieve the use profile properties of item author, whenever an item created on SharePoint list.

Friday 1 June 2018

Configure Microsoft Flow for Sending Office365 SharePoint File Attachments in the Mails


Here, let us look how to configure Microsoft Flow for sending mails with Office 365 SharePoint library files as attachments.

Imagine there is a requirement of sending mails with SharePoint library files as attachments, if a file/item is created/uploaded. Previously we were creating tools for such requirements. Unfortunately, SharePoint designer doesn’t provide option for attaching files in the mails, in the configurations.

Microsoft Flow provides a solution for the above requirement. The solution just includes few configuration steps, which might take one or two minutes of your effort J

Use Case: Whenever a file is created in the folder, send out a mail notification with the uploaded file as attachment to a particular mail box.


Steps Involved:


The following steps shows the detailed configuration steps.
  • Create a Microsoft Flow with a blank template as base.
  • Select SharePoint connector, search and select “When a file is created in a folder” trigger. In the trigger, Provide the site address URL and select the necessary library/folder path.

Wednesday 23 May 2018

Creating Office 365 SharePoint Custom Connectors on Microsoft Flow

Here, let us look how the custom connectors can be created for accessing SharePoint data on Microsoft Flow.

Microsoft Flow provides multiple connectors from various services including SharePoint to work with the data. The connectors contain multiple triggers and actions. For SharePoint connector by Out of the Box, Microsoft provides 8 triggers and 28 actions on Microsoft flow.

UseCase: Imagine you want to retrieve the SharePoint user profile data of some user. Currently there is no action available for MS Flow developers to retrieve SharePoint user profile data. Such triggers and actions can be created by developers on the Microsoft Flow platform. In this post, let us look how one such custom action can be created and used on the Microsoft Flow platform.

The configuration involves the following steps.
  1. Configuring Azure AD Application, which provides necessary permissions and helps in authenticating the calls made from Microsoft Flow.
  2. Generating the collection file (Swagger) using postman tool, which will be used as base file while building the custom connector.
  3. Configuring the custom connector, which will make call to SharePoint to get the required data with necessary inputs.
  4. Testing the custom connector created above.
  5. Creating/Configuring the flow, which will also use the custom connector we have created above.


Configure Azure AD Application for Flow Authentications:


  • Create a new app on the Azure Active directory.

Sunday 6 May 2018

Content Classification on Office 365 SharePoint using MS Flow and LUIS

In this post, let us look how the Office 365 SharePoint list content can be classified using Microsoft Flow with the help of LUIS text prediction techniques. Text added to Office 365 SharePoint list are classified and saved back to SharePoint using Microsoft Flow and LUIS.

Consider a scenario of having queries list, and admin wants the queries to be auto classified before routing the queries for solution. Microsoft Flow provides a LUIS connector, which helps in predicting and classifying the text being saved to SharePoint.

Note: In a layman scenario on LUIS portal, categories will be intents and queries will be utterances.


Connecting SharePoint and LUIS using Flow


The solution consists of three steps.
  • Query is created on SharePoint: Flow is triggered, whenever a new item is created in the SharePoint list.
  • Query category is predicted using LUIS: Flow uses LUIS Get Prediction action for classifying the item created. The action predicts the data using the trained app created on the LUIS portal. The output of this step will be matching intents (predicted scores) with the relevant scores.
  • Query is updated with the category predicted: After classification, the top scoring intent from the above step is saved to the respective SharePoint list item’s category field.