Posts

SharePoint CSOM to Create Folders and Sub Folders based on Excel Data

Contents: 1. Reading data from the Excel sheet. 2. Connecting to SharePoint Online Site & Checking the SharePoint list is available or not. 3. Creating the SharePoint Library Folders and Sub Folders. 4. Conclusion. 1. Reading data from the Excel sheet: a. Open Visual Studio, Select New Project Creation and Select C# Console application and provide the appropriate Solution name. b. First add the required references like below.     I . using Microsoft.SharePoint.Client;     II. using System.Configuration; (Used to read the data from the App.config file)     III. using Microsoft.Office.Interop.Excel; (Excel supported file reference)     Note: If above references and not able to add please install the references from the NuGet Package  Manager Console. To Read the values from the App.config file use the below  and declare all the fields globally for re-usability.           ...

Adding days to date while ignoring weekends using Javascript

1. In this post we can learn declaring the date picker in html page and getting the selected value. 2. Setting the date picker control disabling the weekends and disabling the previous dates. 3. Adding the Number of days to Selected date with Excluding the Weekends. HTML Code Snippet: <div>            <label>                Start Date:                 </label>            <input type="text" id="_startDatePicker" readonly>         </div>               <div style="margin-top: 10px;">             <label>Date after adding Days:</label>             <input type="text" id="_duration" disabled>         </div> CSS and JS reference Files: ...

Declaring SharePoint Client Side Taxonomy Picker Control and Reading the Selected Values and Create Item in List

In this post, We will learn how to declare the SharePoint Client Side Taxonomy Picker control and reading the values from it. Step 1: References required to load the Taxonomy Picker Control Correctly. CSS Reference: Try to download it (Refer if  already have in your sites) <!-- CSS Files -->              < link href = "/taxonomypickercontrol.css" rel = "stylesheet" / > <!-- Javacript Files --> JS References Files: < script src = "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" > < / script > < script type = "text/javascript" src = "../_layouts/15/SP.Taxonomy.js" > < / script > < script type = "text/javascript" src = "/taxonomypickercontrol.js" > < / script > < script type = "text/javascript" src = "/taxonomypickercontrol_resources.en.js" > < / script > ...

Filtering the Sharepoint List Taxonomy Column using Rest API

I ran into a strange issue today when using the SharePoint 2013 REST API for Lists with Managed Metadata columns    but I just had a ‘clever workaround’ moment with SharePoint’s oData/REST implementation when it comes to filtering list items based on taxonomy (managed metadata) columns. Now I do not consider myself a developer, so this article is probably a little verbose for some readers, but should be helpful to power users or IT pros. 1. To filter the Taxonomy columns in SharePoint list using Rest API call we need to use the Post method. 2. The Rest API call will give errors some times when the Rest API Query string crosses limit 260 characters that time we will use the Query in the body. Those things are clearly explained in the below example clearly. 3. WE can use the CAMEL Query in the Rest API call this example come under that. < script src = "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" ></ script > < scri...

CRUD Operations on SharePoint List using JavaScript Object Model(JSOM)

JavaScript Object Model Create Item Add one record into ProductsCategory list using below code. //Get the Site var context = new SP.ClientContex( "Your Site URL" ); // Get the Web var web = context.get_web(); // Get the list based on the Title var list = web.get_lists().getByTitle( "ProductCategory" ); //Object for creating Item in the List var listCreationInformation = new SP.ListItemCreationInformation(); var listItem = list.addItem(listCreationInformation); listItem.set_item( "Title" , $( "#CategoryId" ).val()); listItem.set_item( "CategoryName" , $( "#CategoryName" ).val()); listItem.update(); //Update the List Item ctx.load(listItem); //Execute the batch Asynchronously ctx.executeQueryAsync( Function .createDelegate( this , success), Function .createDelegate( this , fail) ); The above code perform the following operations.  To add a new item in the list, the SP.Li...