Skip to main content

Posts

How to upgrade typescript version in a SPFX solution

Why do we need to upgrade typescript version in a SPFX solution? As part of SPFX development we try to install 3 rd party libraries, there is a possibility that we might face type errors. For example, if we try to install ANTD package as part of your solution and use one of its components and try to build the solution. You might be seeing the type errors (TS1005,TS1109) as shown below. Typescript errors How to find out the typescript version? When you build (Gulp build) the SPFX solution you will be able to find out the typescript version from the build log as shown below.  Steps for updating the Typescript version. In SPFX solution typescript version has dependency on the @Microsoft/rush-stack-compiler package version.  In the package.json if you have @microsoft/rush-stack-compiler-2.7 then the typescript version is 2.7.x.    In the SPFX solution deleted the node_modules folder. It will remove all the packages that are installed.  On the package.js
Recent posts

Microsoft Graph API and SharePoint

While developing solutions for office 365 Microsoft graph API will help you in achieving the required output. In my previous project where I have used Graph API, I found it difficult for getting info on some of the endpoints. Below I will try to list out some of the basic and most used end points of Microsoft graph API for SharePoint. Getting site level information Searching for Sites https://graph.microsoft.com/v1.0/sites?search=* it returns the list of site collections the user have permission. Site details based on the relative path https://graph.microsoft.com/v1.0/sites/{host-name}:/{server-relative-path} if the site collection url is https://contoso.sharepoint.com/sites/test1 Host-name:- contoso.sharepoint.com Server relative path:- sites/test1 Graph Url:- https://graph.microsoft.com/v1.0/sites/contoso.sharepoint.com:/sites/test1 Different ways to get list data Get the list data for a root site https://graph.microsoft.com/v1.0/sites/root/

Youtube Video Search on Sharepoint

Youtube Video Search on Sharepoint!! Scenario :- Users should be able to search for youtube videos and play them. Pre-Requsite :- Basics of React and sharepoint content editor webpart. UI Layout :- React App steps for build The react solution has total five componenets of which only one is class based component all other are functional components. App Search Bar Video Details Video List Video List Item For searching youtube videos from the youtube we use youtube-api-search package. We also need to have an API Key for youtube to know who is searching the videos. NPM install youtube-api-search We can use the YTSearch function from the api to perform the search. In the callback function we get the list of videos. App :- It’s a parent componenet which holds all the child components. Its contains internal state of Videos and selected Video.   Search :- It’s a functional component where we show a search box and onchange ev

Add Items to sharepoint online List using powershell!!

SharePoint online provides only a small set of basic commands for writing powershell scripts. IF we have to do any operation using powershell we need to use CSOM or REST API.   Sharepoint patterns and Practises (PnP) team came with a powershell module for doing operation on the sharepoint online. Its very help full while writing scripts.   Similar modules exists for Sharepoint 2013 and Sharepoint 2016.   Link to the Github respositry. In the below article I will try to add items to a list picking the data from the JSON file.           Try to check whether SharepointPNPPowershellOnline module was installed or not. If not install it. # This script adds items to the list picking up the data from the json file. if (-not (Get-Module -ListAvailable -Name SharePointPnPPowerShellOnline)) { Install-Module SharePointPnPPowerShellOnline }           Get the data from the json file and store it in a variable. We can read the data from a json file similar to how we

Use of Expression in Microsoft flow through an example

Most of the basic flows can be configured using the templates provided by Microsoft. But in real time we will be developing flows which have complexity. Expression play an important role in fulfilling the requirements. Scenario : -  We have project details list which has the below columns, we need to intimate the project team before 2 days of the end date. (Please note that this scenario is picked up from one of the Microsoft insight demo) The following points needs to be implemented ·          Only title and End time are mandatory fields, Start time if not entered needs to be taken as the current date. ·          Number of days is the difference between the start time and end time.   ·          Email needs to be sent before 2 days of the end date. ·          If any attachments they need to be attached to the mail being send from the flow. Below is the complete flow. If any one needs a copy of the complete flow please drop a comment. Let m

Syncing calendar events from outlook to Gmail calendar using Flow.

Recently I started working on Microsoft flow for one of the client where we are migrating the workflows from SPD (SharePoint designer) to Microsoft flow.  I liked flow for the way  we can automate some of the small daily tasks.    Flow  provides  us connectors through which we can connect many applications to the flow like  Gmail .  Flow gives us lot of templates which we can start with or create a new flow starting from  b la nk .    Scenario:-     I want to sync my outlook calendar (company) to my google calendar which is  available on my android phone.   S ync ing  my  company's  calendar which helps me in tracking of my events on my mobile.    Prerequisites:-     Having a Microsoft online account for log ging into the Microsoft flow.   Trigger :-     A new calendar event on the Microsoft outlook calendar.   Steps for creation of the flow.    Steps for creation of the flow.    Navigate to the Flow  connections page and cr