Tuesday 7 May 2019

Power BI Reports with Map Visualizations For Office 365 SharePoint List Data

Let us look how to integrate and show the Office 365 SharePoint data on to Power BI reports. In this specific use case, we will look how to SharePoint data as map views.

Consider a very basic scenario of showing organization location-wise user count on Power BI dashboards. So in this case, the organization data is available as SharePoint list, and consider only two parameters, that is location and user count.

The below snapshot shows the data loaded onto Power BI. Let us see step by step approach below.
PowerBI showing the SharePoint List Data as Locations on Map Visuaization
PowerBI Report showing the SharePoint List Data as Locations on Map Visualization

Thursday 11 April 2019

Restrict Permissions on Editing SharePoint SPFx Property Pane Configurations

Let us look, how the SPFx web part property configurations changes can be controlled by user permissions.

Let us assume a scenario, where administrators can only change the SPFx web part property values.

The following steps helps achieving the requirement.
  • The permissions of logged in user details could be identified using the context/page context.
  • While rendering the property pane configurations, the current user permissions could be checked.
  • So the properties could be enabled based on the permissions, i.e., properties will be editable, if user has admin access to the site.

This could be achieved, using the WebpartContext property and SPPermission class.

The object is initialized, using the current user permission details, and then site permission is checked for user.
    let permission = new SPPermission(this.context.pageContext.web.permissions.value);
    let isAdmin = permission.hasPermission(SPPermission.manageWeb);

Sunday 7 April 2019

Using MS Graph API and Adaptive Cards for Search/Render User Details with SPFx solutions

In this article, we will learn how to develop SPFx webparts for Office 365 SharePoint site and Microsoft Team, that leverages Microsoft Graph to search users and adaptive cards for rendering the user data effectively.

The sample used here uses the adaptive card, which has a very minimal UI. The sample used, shows how effectively UI could be changed by users. But complex custom UI could be built using the adaptive cards.

Adaptive Cards:

Let us use the adaptive card on our SPFx component for displaying user details. The following provides you the basic understanding.
  • Introduced recently, a new way for developers to render content in a consistent way, which is a open framework. 
  • It is providing options for developers, to design the UI for the specific component, using schema or visually.
  • https://adaptivecards.io/designer
  • Primarily targeted for BOT frameworks, Teams, Cortona, and windows notifications.
The following snapshot showing the UI built for our sample. This snapshot has 2 container sets for displaying 2 user details. In the schema mentioned later in the article, the single container is used, which could iterated using for loops for building containers for the required user set.

Adaptive Card Visual Interface for building component with UI
Adaptive Card Visual Interface for building component with UI

Monday 1 April 2019

Using Azure Devops & Github to Automate SPFx solution Packaging Processes for MS Teams and SharePoint

In this article, we will understand how SPFx solutions built for MS Teams and SharePoint portals, could be automatically packaged and uploaded into app catalog portals. This automation is achieved with the help of Azure Devops and Github version control systems. Using devops ensures us the continuous delivery of changes onto the target platforms.
  
Remember, we will be targeting the webparts of this solution for SharePoint and as tabs for Microsoft Teams. Let us use github repositories as a version control tool for storing the solution. You will understand, how github could be easily integrated with Azure Devops for automating the packaging processes in this article. 

Create the SPFx solution, that is compatible for SharePoint online portals. The SPFx solution (available on the github https://github.com/nakkeerann/globalspfxsoln) contains, the azure-pipeline configuration file template for setting up the build pipelines. The following snapshot shows the configurations for creating SPFx solution. 

Push the code into Github using the git commands. For example, below commands are used for my repository.
git initgit add .git commit -m "first commit"git remote add origin https://github.com/nakkeerann/globalspfxsoln.gitgit push -f origin master


Install the Azure Pipelines to your Github account https://github.com/marketplace/azure-pipelines . Select the repositories required to install pipelines. Authorize azure pipelines. 

Friday 15 March 2019

Office365 SharePoint: Validate & Transform XML Data from Enterprise Systems into SharePoint using Azure Logics App

In this article, you will understand how the XML content from enterprise systems is first validated and converted/transformed to JSON, and pushed to Office 365 SharePoint online lists. We will be leveraging the power of Azure services, to achieve everything with just configurations.

The services used under Azure will be
  • Logics App
    • The entire flow will be set here. 
  • Integration account.
    • With in integration account, we will store the schema and map files to validate and transform the data.

In my previous article, you have seen how the JSON content from enterprise systems is flowing into SharePoint online. There, we have not focused on validating the JSON data, since HTTP trigger by default validates.

We have seen the introduction to the features being leveraged in the previous article. Let us get directly into the business scenarios.


Business Scenario


Assume an enterprise system exposes XML data to multiple systems. We will consider source system to be HTTP service (for our POC) and the target system to be SharePoint. The XML data from source system cannot be directly feed into SharePoint. For this purpose, we need to transform the XML content, into the required format. The following picture depicts the transformation. The data being transformed is a SharePoint list item entry, along with metadata properties required for the list item.
Data Representation between two systems. Left - XML data from HTTP service, and Right - JSON data compatible for SharePoint
Data Representation between two systems. Left - XML data from HTTP service, and Right - JSON data compatible for SharePoint list