Skip to content

Instantly share code, notes, and snippets.

/*
Code is used in YouTube video at : https://youtu.be/9TbjtS0mzlo
Below code depends on two utility SPOHelper and BatchUtils
For SPOHelper -> https://anomepani.github.io/posts/spohelper-sharepoint-online-rest-api-crud-operation-utility-with-example/
For BatchUtils -> https://anomepani.github.io/posts/make-batch-request-with-rest-api-in-sharepoint-online-sharepoint/
You can skip SPOHelper if you want and instead of that you can right your own logic to get Request digest pass to below methods
*/
/*
Below code depends on two utility SPOHelper and BatchUtils
For SPOHelper -> https://anomepani.github.io/posts/spohelper-sharepoint-online-rest-api-crud-operation-utility-with-example/
For BatchUtils -> https://anomepani.github.io/posts/make-batch-request-with-rest-api-in-sharepoint-online-sharepoint/
You can skip SPOHelper if you want and instead of that you can right your own logic to get Request digest pass to below methods
*/
//Step 1: Initial Setup
@anomepani
anomepani / UpdateItemWithoutIncreamentingVersioning.js
Created July 13, 2019 06:35
Update Sharepoint list Item Without Increamenting Versioning
//How to use
//UpdateItemWithoutIncreamentingVersioning(1,"Title Update without increamenting version control",true
function UpdateItemWithoutIncreamentingVersioning(itemid,title,RestrictVersion){
//payload for request
body= {"formValues":[{"FieldName":"Title",FieldValue:title}],bNewDocumentUpdate:RestrictVersion}
//Header data for sharepoint POST Request
var _payloadOptions = {
Agenda - Sharepoint Online/ Office 365Important tips for bulk operation
1. Bulk Insert Into Sharepoint List
for(var i=11;i<=20;i++){util.Utils.ListItem.Add({listName:"BulkOperation",data:{Title:"Test"+i,Department:"IT_Computer"}}).then(r=>console.log(r))}
2. Bulk Update into Sharepoint List
body= {"itemIds":[11,12,13,14,15,16,17,18,19,20],"formValues":[{"FieldName":"Title","FieldValue":"Bulk_Update-Title"},{"FieldName":"Department","FieldValue":"HR"}]}
var SPRest = /** @class */ (function () {
function SPRest(rootWeb) {
var _this = this;
this.Utils = (function () {
/**
* Reference or motivation link : https://github.com/omkarkhair/sp-jello/blob/master/lib/jello.js
* https://github.com/abhishekseth054/SharePoint-Rest
* https://github.com/gunjandatta/sprest
*/
var reqUrl = _this.rootUrl + "/_api/web/lists/getbytitle('AWSResponseList')/items";
<html>
<head>
<!-- Add Kendo Grid CSS Reference-->
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2018.2.620/styles/kendo.common-material.min.css" />
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2018.2.620/styles/kendo.material.min.css" />
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2018.2.620/styles/kendo.material.mobile.min.css" />
<link rel="stylesheet" href="style.css" />
<!-- Add Kendo Grid Js Reference -->
<script src="https://kendo.cdn.telerik.com/2018.2.620/js/jquery.min.js"></script> <!-- jszip required for export to excel-->
<script src="https://kendo.cdn.telerik.com/2018.2.620/js/jszip.min.js"></script>
$(document).ready(function() {
console.log("** Dom is ready **");
// Dom is now ready, Need to initialize kendo grid
// Define which columns should be visible in kendo grid
var columnOptions = [{
field: "CustomerID",
editable: false
}, {
field: "ContactName",
title: "Contact Name",
//Required Namespace for usage in predicate builder
using System;
using System.Data;
using System.Data.Objects;
using System.Data.Entity;
using System.Linq;
using System.Web.Mvc;
// Model class
/// <summary>
/// Enables the efficient, dynamic composition of query predicates.
/// </summary>
public static class PredicateBuilder
{
/// <summary>
/// Creates a predicate that evaluates to true.
/// </summary>
public static Expression<Func<T, bool>> True<T>() { return param => true; }
var fs = require('fs');
var cheerio = require('cheerio');
var fetch = require("node-fetch");
//const axios = require("axios");
var csharpURL = "https://www.c-sharpcorner.com/technologies";
var categoryResult = [];
//const axios = require("axios");
const getArticleCountByCategory = async(url, article) => {