Posts

Showing posts from January, 2022

Get SharePoint list name by GUID

Image
 Get SharePoint list name by GUID in jQuery: Use the below snippet code to get the name of list by using listGuid . To do so replace the below list guid with your SP list GUID. var listGuid = "aa4774cf-oa71-83e4-6a67-01b53d5a7y6i2";//use your own SP site list guid getlistNameByGUID(listGuid); function getlistNameByGUID(guid) { $.ajax({         url: _spPageContextInfo.siteAbsoluteUrl + "/_api/Web/Lists(guid'"+listGuid+"')",         method: "GET",         headers: { "Accept": "application/json; odata=verbose" },         success: function (data) {              console.log(data.d.Title);         },         error: function (e) {             console.log(e)         }   }); } Output: Company//list name of my sp site  Was this helpful? Comment you suggestions and share it with yo...

create/insert new records to a sharepoint list using REST API

Image
 Create/insert new records to a sharepoint list: To create/add new records in a SharePoint list using REST API, we need these thngs. 1) List Name (Company Details) and its Entity Type Full Name 2) Data that we need to add in list and internal name of Field (Contact Name) and id if it is a lookupfield (Company) var postData = { __metadata: {type: "SP.Data.Company_x0020_DetailsListItem"},// List Item Entity TypeFullName CompanyId: 3, //lookup field id Contact_x0020_Name: "Himanshu Shekhar",//Text Field Package_x0020_Status: "Open", // Choice field Plan_x0020_Holder: true };       var listEndPoint = _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getByTitle('Company%20Details')/items"         $.ajax({           url: listEndPoint,           method: "POST",            async:false,              headers: {       ...