Posts

Showing posts with the label Microsoft

Cloud Computing: Some of the common used terms

Image
  T oday, I will be starting to include my articles on the topic of cloud computing, since I am from a Microsoft stack background so mostly Azure but in the future, I will try to cover AWS and Google as well. So to start with I will be sharing the concepts of some very commonly used terms in this field What is Cloud Computing? Cloud Computing i s the delivery of computing services over the internet Cloud computing consists of 2 major things Computation Storage What is meant by High Availability? High availability is the SLA (Service Level Agreement) for which the provider commits the uptime of the service provided to the consumer. There is a difference between the uptime of 99% and 99.9% Usually, we think that there is not much difference between 99% and 99.9%  uptime, but the below image can explain, so choose wisely. What is meant by Scalability? Scalability is the ability to adjust resources to meet demand Vertical Scalability : To add/reduce the capabilities of the resourc...

Power Automate: Rename file in SharePoint Online

Image
  We often get to change the name of the file, so in this article, I will explain how to rename the file in SharePoint Online using Microsoft Power Automate. Below is the file which I will be renaming. Step 1: Get the file properties We only need to have the SharePoint item id, for which we want to rename the file Step 2: Update the File Name Add the "Send an HTTP request to SharePoint" connector, and update the following properties Method : POST Uri : _api/web/lists/GetByTitle(' <LIBRARY TITLE> ')/items( <ITEM ID> )/ValidateUpdateListItem Body: {     "formValues" :[         {             "FieldName" : "FileLeafRef" ,             "FieldValue" : "<New File Name>"         }     ] } Execute the flow, and the file will be renamed Happy Automating..!! #PowerAutomate #SharePointWidgets #Microsoft

Power Automate Tip: Reduce loop to improve performace

Image
  If you are creating very complex flows using Microsoft PowerAutomate which contains loops ( Apply To Each connector), you must have noticed that performance degrades sharply.  I had a loop of 120 items with some complex business logic, which was taking around 40 mins to execute the complete flow. But after I have removed the loops and reduced the number of variables now flow gets completed in less than 8 mins. So you can imagine the performance if your flow is going to be executed on a very large dataset. To improve the performance of the flow, it's necessary to reduce the loop count and to do that  I count on the 2 best functions from Power Automate. To explain the below functions, I will take a scenario where there are below fields  Title City State #1: Select You can make use of the Select function to create a collection/array of single-valued or complex objects, even without looping each item. Case 1:  Suppose I want to collect all the cities from all the...

Power Automate: How to Add "New Line" to the text in SharePoint multiline text field

Image
  Q. How to add "New Line", while adding the text to the SharePoint multiline text field?  A . In order to add the new line while adding a text to the multiline SharePoint field, I will demonstrate the simplest approach. Although you can find multiple approaches, but this one seems to be very easy and quick. You need to append the below expression to the text to make it to the new line: decodeUriComponent('%0A') If you are adding any array, then join the array using this expression or if you are building this string, then append this expression to the string. Step 1:  Add a variable and add the below expression (Write the code under the Expression tab) STEP 2: This is how your variable will look like      STEP 3: Output of the Address columns which is of Type Multiline text field Happy Coding..!! #Microsft #SharePointWidgets #PowerAutomate

Retrieve SharePoint List Item Versions in SharePoint Online using PnP

Image
  In many cases, we need to identify the versions of the SharePoint List Item. So here is the way to get all the versions of the item using PnP. function   Get-ItemVersion  {      param  ($spURL, $spListTitle)           $checked  =  ([ char ] 8730 )           Write-Host   " Creating connection to the SharePoint Online..... "   - ForegroundColor Yellow  - NoNewline     $spConnection  =   Connect-PnPOnline   - Url $spURL  - UseWebLogin  - ReturnConnection  - ErrorAction Stop      Write-Host  $checked  - ForegroundColor Green       Write-Host   " Reading list items from ' $listTitle '..... "   - ForegroundColor Yellow  - NoNewline    ...

Function for Digital Unit Conversion in Power BI (KB, MB, GB...)

Image
  While displaying reports it is very common to convert the units. So today I will be displaying the function that can be used in order to convert the Units Space  = VAR  total  =     SUM ( Table1[ Used   Space ] )  +   0 RETURN      IF  (         total  <   1024 ,         FORMAT ( total,  " #0.0# B "  ),          IF  (             total  <  POWER (  2 ,  20  ),             FORMAT ( total  /  POWER (  2 ,  10  ),  " #0.0# KB "  ),              IF  (   ...

Logging in SharePoint Framework Solutions

Image
Hi Friends, today I will be discussing about how logging should be done in SharePoint Framework of SPFx solutions. Logging plays a very important role when we need to debug the code in the production for any error and improper or no logging makes it really hard to find the root cause of the issue. While logging we need to take care of the following pointers What information needs to be logged Where to log How long it should be maintained etc... To take on this burden, Microsoft has given a dedicated class for the logging which can be utilized well to make the purpose. @microsoft/sp-core-library This library holds the solution. In sp-core-library Microsoft has exported a class name " LOG " which contains the static methods to write the logs Below the how you can import the class into your solution import { Log } from ' @microsoft/sp-core-library ' ; In this class, you'll get 4 static methods Error Verbose Info Warn Let's have a look on how to use each of the me...

Export SharePoint List to Microsoft Word using SharePoint Framework Extension (List view command set)

Image
 Hi Friends, With the introduction of SharePoint list view formatting, I have realized that the scope of playing with the lists has also increased. I was working on one of the list view formatting and thought how if someone wants to export the list items to a Microsoft word? For example, if one creates the FAQ in a SharePoint list, it can be made visibly beautiful using the list view formatted, but if they need to export the same in a word document then? So I came up with the idea of exporting the SharePoint List items in the Microsoft Word format and created an extension which with one click exports the list items in the Microsoft Word. for source code click here. Features..!! Exports all the list items from the SharePoint list to the Microsoft Word with beautiful formatting. Want to export only a few items? Just select the items and click on the export and it will export only the ones you want. Export the items with fields based on the current view fields If the view contains exa...

SharePoint List View Row Formatting: Ideation Management

Image
Hi Friends, In this blog, I have created a formatted for the ideation management. In most of the organizations we do have it, some are having it as an isolated product and some of them have it in a SharePoint List.  So I have come up with a design, which will help in managing the ideation more efficiently. Look into the features and it might attract you 😊 You can find the code here Features..!! Clear identification of the stage of the idea Filter on the base of the stage of the idea Clear display of the estimated budget and benefits from the idea Clear display of the Risk of the idea Assign medal to the idea which is most valuable Columns needed for the view Title Description Submitter Budget Cost Benefit Estimate Risk Rating Stage Assign Medal Hope this view will help you. Happy Coding..!! #Microsoft #SharePointWidgets #ListViewFormatting

SharePoint List View Row Formatting: Deployment Schedule

Image
Hi Friends, Many of us have maintains the deployment schedule in SharePoint List and with a lot of columns and information, it is really painful to have a view with all relevant information. Today I had worked on the SharePoint Deployment Schedule list to give it an interactive view so that one can know about the status one first sight. Code can be found here With the help of JSON, the view displays the current status of the deployment for different environments, the responsible person, and the spring in which it was to be deployed. There are two views, List View Tile View To get the view following columns will be needed Title Application Package Version Status QA Deployment UAT Deployment PROD Deployment Responsible QA Deployment Sprint UAT Deployment Sprint PROD Deployment Sprint Hope this post will help you. Happy Coding..!! #Microsoft #SharePointWidgets #ListViewFormatting

List View Row Formatter - Issue Tracking

Image
Hi friends, Microsoft has changed the SharePoint drastically and now we do not need to write the custom solution for every need and take a toll on the performance. List view formatted is very powerful and I think it solves a lot of problems where we need to write the custom code and there is the least performance hit as well. Today I have worked upon the "Issue Tracking List" - list view row formatted. You can find the JSON file here Features Simple view Large view dedicated to the comments section, so once can read all the comments against the issue in a single view without even opening the item A lot of filters, clicking on the below columns filters the list upon that value. So one not need to create multiple views Happy Coding !! #Microsoft #SharePointWidgets

Know your SharePoint Framework (SPFx) version

Image
Hi Friends, Most of the time when we are working on the SharePoint Framework or SPFx solutions, the version of each component can create issues while building the solutions. One of the common issues is with the SPFx version. SPFx version is the version of the SharePoint Framework yeomen generator installed on your machine. With the difference in the version, a solution might differ in the import versions of other libraries, change in solution scaffolding, and more... ➡️Steps to know your SPFx version Open the console  Type in the following command  npm ls -g --depth=0 @microsoft/generator-sharepoint Hit enter and wait for a few seconds. You'll get the response   Happy Coding #Microsoft #SharePoint #SharePointWidgets

4 Useful VS Code extensions for SharePoint Framework components

Image
Hi Friends, Today I will talk about the most useful VS Code extensions, that will help in the productivity of specifically SharePoint Framework projects. As a developer, we waste a lot of time in the tasks that could be done easily via extensions support or shortcut keys. In this blog post, I will discuss some of these extensions that will increase the productivity and the style of your code. With an increase in productivity, the styling also holds an important value as it makes the code more readable and understandable which increases the focus time. So let's dive then !! VS Code Extensions !! Debugger for Chrome:  A very important extension if you are a SharePoint online developer (developing SharePoint framework components) then it is a must to have this extension. This extension helps in debugging the SharePoint Framework components just as we used to do in the C# server-side coding. For details on how to configure, you ca...

Powershell script to delete the Modern Pages in SharePoint Online

Image
Hi Friends, In one of the scenarios I have written a PowerShell script to delete large number of pages. Since this activity can be very common, so I thought to share it here as well. Here is the PowerShell script. Happy Coding Sumit Kanchan #SharePointWidgets #Powershell

SharePoint Framework (SPFx) Tab Control (react)

Image
Hi Friends, This time I have worked upon a tab control which is still missing from Microsoft sample collection. I personally felt this tab control webpart can be of use in many scenarios. I have used the Rich Text editor for the implementation, where whenever a new tab is added , the text editor automatically gets associated with the tab. Since it is the rich text editor so you can do almost everything you want to display with all the custom formatting options available. Source Code on GitHub Features ! No configuration for the webpart to use Safe and fast as there is no external saving of data Rich Text editor increases lot of possibilities how you use it Light weight control Installation $ npm install $ gulp clean $ gulp bundle --ship $ gulp package-solution --ship Below are some of the images that demonstrates the webpart. View Mode Edit Mode Please provide your comments , if you need any more feature or how you like the control. Hap...

Custom Control for Property Pane in SharePoint Framework (SPFx) Solution

Image
Hi Friends, In today's blog I will be explaining how to create a custom control for Property pane in SharePoint Framework, Many times we need a functionality which we cannot be fulfilled using the OOB (out-of-box) controls. For which we have to go with the customized solution. A very basic need that I encountered and will showcase in this blog is the display of colored text with some sort of icon in the Property Pane. For this we can use label but you cannot change the color of the text and there is no property to handle the icon class as well or you cannot add custom css based on the logic. So to demonstrate and understand how the custom control can be created and functions in Property pane of a SharePoint Framework solution. To implement this functionality I will be extending the properties of a Label and adding some more properties to achieve the functionality. Let's start with the structure and it's explanation then we'll move through the code inside ...

Model Driven App in PowerApps

Image
HI Friends, Today blog is about the basic understanding of the Model Driven PowerApps.  After too much googling for the understanding I have found this 4 video series, after which you will have a better idea about the Model Drive PowerApps. Getting Started with Model Driven Apps Model Driven App Components Part 1 Model Driven App Components Part II Model Driven App Components Part III Happy Coding Sumit Kanchan #SharePointWidgets #PowerApps #ModelDrivenApp

Hiding Left Navigation from the Modern Team Site in SharePoint

Image
Hi Friends, We usually have a very simple requirement that many times we don't require the left navigation. There can be multiple reasons around it. In modern SharePoint Communication site, Microsoft has given is out-of-box, where the navigation is at the top. But what if you want to hide the left navigation from the Modern Team site. So here is the solution Go to Site Settings Click on the " Navigation Elements" under Look and Feel. Un-check the " Enable Quick Launch " option Click OK And now you'll notice that the left navigation option is no more. Pros: Left Navigation is removed Now the content area has full width Webparts will act as the full width webpart , and limitation of "Full width section" is not there as the common section is now acting as full width Content can be more expressive Cons: No more navigation on the whole site. Happy Coding Sumit Kanchan #SharePointWidgets #SharePointOnl...

PowerShell Script to update Page Layout in SharePoint online using PnP

Image
Hi Friends, I have came across a very common requirement where I need to update the page layout of the SharePoint online page (classic page), but I think same can be used to update the page layout to the modern SharePoint site. For this I have written a PowerShell script which will update the pages from a specif page layout to the desired page layout. In this script I have also taken care if you are updating the page layout of the subsite, than also this script will handle the scenario. There are 2 parameters which you need to update Old page layout title New page layout title The updation due to this script will not change the modified by as well as modified date, so the original data is not lost. Please provide your comment if you feel that something can be enhanced in the script or if there is any issue

Checking user permission in SharePoint Framework (SPFx) webpart

Image
Hi Friends, Many times we need to show the controls based on the user permission while creating the custom SharePoint Framework (SPFx) webpart. The first thing we look for is the endpoint to retrieve the information from SharePoint. In this blog I will tell you how this can be achieved without any endpoint as this information is already available in the SharePoint Framework (SPFx) webpart. So, if you look into the <WebpartName>webpart.ts file , you can find this information in the current page context this .context.pageContext.web.permissions Now we get three methods with this hasAllPermissions : Checks if the user has all the permissions hasAnyPermissions : Checks if the user has any permission from the collection of permissions hasPermission : Checks if the user has given permission value : Returns the current user permission set Now talking of the permissions, you'll get a variety of permissions. For this SharePoint has the SPPermission class. ...