Posts

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: {       ...

Get list item entity type full name of a SharePoint list using REST API

Image
Get list item entity type full name of a SharePoint list using REST API : Follow the below steps to get ListItemEntityTypeFullName which must required for adding/updating items/records to the server or the SharePoint list. 1) First user/developer need logged in to the SharePoint site and then copy any of below URL/API. 2) Replace the _spPageContextInfo.webAbsoluteURL or siteurl (absolute URL) with the URL of you site for example. siteurl = https://testcompany.sharepoint.com/sites/testsite1 3) and replace SharePoint ListName = Payments or you original list name 4) Finally hit or place the complete URL/API API = https://testcompany.sharepoint.com/sites/testsite1/_api/Web/Lists/getbytitle('Students')/ListItemEntityTypeFullName into the browser search bar/box and click on enter button from keyboard then you will able to see output as shown in Output below   _spPageContextInfo.webAbsoluteUrl + "/_api/Web/Lists/getbytitle('ListName')/items?select=EntityTypeFullName OR s...

Send mail using SharePoint REST API in jQuery/JavaScript:

Image
Send mail 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 can able to send email to valid SharePoint user of same organization.      window.getErrorMessage = function (err, listText) {       var errorMessage = 'An error occurred. Please try again.';       console.log(err);       if (err.responseJSON != undefined && err.responseJSON.error != undefined && err.responseJSON.error.message != undefined) {         errorMessage = err.responseJSON.error.message.value;       } else {         if (err.readyState == 0) {           errorMessage = 'Your browser is not connected with target Server (or Check your internet connection).';         } else {           errorMessage = errorMessage;     ...

How trigger a MS flow from an application in JavaScript/jQuery?

Image
  Trigger a  MS Flow Using Jquery/JavaScript: To trigger an MS Flow first we need to create an workflow. Next we need to obtain its URL for triggering it. In below example, we are starting a workflow which is taking email address, email subject and email body as parameter and sending mail to email of related user. //This function triggers the microsoft flow  function startMSFlow() {          var httpPostUrl = "obtain URL from MS flow";          var postData = {              emailadress:'raju@testdev.com', // Object keys must be similar as you used in the MS flow             emailSubject:'Testing Raju',              emailBody:'Hello User\n Welcome, You just trigger a MS Flow'             };           $.ajax({           url: httpPostUrl,   ...

How to get entries or values of a multi select lookup field of a MS Project from Project Server using code?

To get entries or values of a multi select lookup field of a MS Project from Project Server using code:    //First we need Id of custom multi value lookup field             var customFieldId = "d10e13f5-01c2-eb11-bb97-00155dac5921"; //Custom Field ID             function getLookupdata(lookupFieldID) {                 $.ajax({                     url: _spPageContextInfo.webAbsoluteUrl + "/_api/ProjectServer/CustomFields('" + lookupFieldID + "')/LookupEntries",                     method: "GET",                     async: false,                     headers: {                         "accept": "application/json;odata=verbose"...

How to update values in a custom multi lookup field Field (lookup Table) of MS Project using JavaScript/jQuery?

 Updating values in the custom multi lookup field Field of MS Project using JavaScript/jQuery: First of all we need to know the steps of Project Online for its update/add Step 1: CheckOut a Project Step 2: Update detals in same as in Step 1 Project Step 3: Publish a Project Step 4: CheckIn a Project We always in need to follow the above steps to update any Project to MS Project/Project Server. Same we need to follow in code too.    //Step 1: First, we need to define all the required functions, the below Functions are callback functions             window.checkOutPWAProject = function (projectId, callBack) {                 var checkOutURL = _spPageContextInfo.webAbsoluteUrl + "/_api/ProjectServer/Projects('" + projectId + "')/checkOut()";                 $.ajax({                     url: checkOutURL,     ...