Posts

Showing posts from 2019

Change Image on Every Page Load using Random Number Generator

How to Change Image on Every Page Load using Random Number Generator You can use the below code to change Image on Every Page Load JS Code: - var length; $(document).ready(function() { getFoldersTraining_dev(); });      function getFoldersTraining_dev() {          $.ajax({             url: _spPageContextInfo.webAbsoluteUrl + "/_api/Web/GetFolderByServerRelativeUrl('/teams/FMHub/Quotes_image_homepage')?$expand=Folders,Files",             type: "GET",             headers: { "Accept": "application/json;odata=verbose" }, // return data format             success: function (data) {               var html = "";                if(data.d.Files.results.length >0){                     ...

Save Data to SharePoint list using REST Api

How to Save Data to SharePoint list using REST Api You can use the below code to save data to SharePoint list using REST Api JS Code:- $(document).ready(function() {  $("#btn").click(function(){     CreateListItem();  }); }); function CreateListItem()    {      $.ajax         ({         url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/GetByTitle('TestRestList')/items",         type: "POST",         data: JSON.stringify         ({             __metadata:             {                 type: "SP.Data.TestRestListListItem"             },             "Title": "Title"                  }),       ...

Get More than 5000 records from SharePoint list using Rest Api

How to Get More than 5000 records from SharePoint list using REST Api You can use the below JS code to get more than 5000 records from SharePoint list using REST Api JS Code:- var response = response || []; var url = _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/GetByTitle('Cable_Status')/items?$Select=ID,LOB&$top=1000"; $(document).ready(function() {  GetListItems();   }); function GetListItems(){         return $.ajax({             url: url,             method: "GET",             headers: {                 "Accept": "application/json; odata=verbose"             },             async: false,             success: function(data){                 response = resp...