Posts

Showing posts from December, 2021

Get SharePoint list items using PNP/SP - React in SPFX web part

Image
Hope this post finds you well. I have just started learning SPFX and and I found it pretty interesting using React. TypeScript is a whole new world than a legacy development technique. It gives you new ways to think and implement your code. Let start working and stop talking. Note: Before starting this article, it is assumed that you have already setup your environment  according to Microsoft's guidelines. This is very important that you read and perform all the installation steps carefully as if there will be a minor change in the installation software versions, you won't be able to do many operations later on. Steps that we'll do to achieve this task are below: Create solution and web part using YO. Install PNP/SP Create SharePoint list Write React and PNP code Test web part on workbench Lets start...!   ✌ 1. Create solution and web part using YO. First, lets create a solution and choose a web part to create. For this, create a folder in your drive with the project name.

Clone or Copy SharePoint Online Site Collection With Lists Content

Image
Modern problems need modern solution...! Although we have spent years with SharePoint On-Premises but its time to move on SharePoint Online. Being SharePoint Administrator in past, now you may have to deal with Microsoft Cloud Admin. It was pretty easy in good old days to copy or clone a site using backup restore or using export import methods. However, that thing do not work anymore in SharePoint Online. You have to try different approach and syntax for this. There are several articles on this but I found this one which lead me to different type of errors and ultimately to the actual solution I was looking for. Here is how I did it... There are three main components in this article. Create a Site in SharePoint online with some dummy data Use PNP PowerShell to backup the site template and list data Create new site and restore the template Important :  The commands I will be using in this article are different than the used in above mentioned article. To run these commands, you need to

How to enable Content Editor and Script Editor web parts in SharePoint Online?

Image
Although Microsoft recommends to adopt the new technology and customize the SharePoint Online portals through SharePoint Framework, we often come to face the customer's requirement where the customizations go far beyond the out of the box layout and demands something which is not available in Modern pages and layouts. In those scenarios, we have to go back to the classic approach and use the client side scripts and web parts to achieve the functionality. Content Editor and Script Editor web parts were such a blessing during the SharePoint on-premises days and we would love to have them back in SharePoint Online which is currently not available by default. To enable these two champions, there are two ways. Method 1: You can also directly access the Tenant Settings page directly from the browser by accessing the below URL: https : //sharepointerguy-admin.sharepoint.com/_layouts/15/online/TenantSettings.aspx In this page, if you will navigate to the Custom Script section, then you wil