Skip to main content

Posts

Showing posts from February, 2021

How to send email using SharePoint REST API in jQuery/JavaScript?

  Send email using SharePoint REST API in jQuery/JavaScript: We can able to send email to the SharePoint user using below REST API on SharePoint Online. We need to load SP.js file in code. we must need to give valid SharePoint user to send email. We can able to send email to valid SharePoint user of same organization.      var   restAPI  =  _spPageContextInfo . webAbsoluteUrl  +  "/_api/SP.Utilities.Utility.SendEmail" ;      $ . ajax ({          contentType:   'application/json' ,          url:   restAPI ,          type:   "POST" ,          data:   JSON . stringify ({              'properties' :  {             ...

How to delete a number of data at time using $batch REST API from SharePoint list?

 To delete a number of data (max-1000) at time using $batch REST API from SharePoint list:- Use below snippet to delete records from SharePoint list. The below code will help you to delete more than 1 records at single REST API. We can able to delete upto 1000 records at time. After 1000 items, it will show error like "The current change set contains too many operations. A maximum number of '1000' operations are allowed in a change set." So do not try to delete more than 1000 records at time. We can delete more than 1000 items using 200/300 records at a time single REST API call. We can call this deleteListItems function 5 to 6 times.  < script >      $ ( document ). ready ( function (){          var   data  = [         {  'ID' : 1 ,  'name' : 'Tester1' , 'email' : 'tester1@gmail.com' ,  'mobile' : 9832145326 ,  'address' : 'Gurgaon,...