Posts

Showing posts from April, 2020

Some Important SharePoint REST API related to SharePoint list.

Some Important SharePoint REST API related to SharePoint list. Get all lists of Current SP Site = https://{siteurl}/_api/web/lists      //CRUD list. // siteurl may be like https://mycompany.sharepoint.com/sites/teamsite REST API to get field by  field name = https://{siteurl}/_api/web/lists/getbytitle('Projects')/fields/getbytitle('Status') GET SP list meta Data             = https://{siteurl}/_api/web/lists/getbytitle('SP List Name') GET Fields/column of SP list  = https://{siteurl}/_api/web/lists/getbytitle('" + listName + "')/fields GET SP list fields with filter    = https://{siteurl} /_api/web/lists/getbytitle('SP List Name')/fields?$filter=Title%20eq%20%'Email' Get GUID of List                     = https://{siteurl}/_api/web/lists/getbytitle('SP List Name')/Id Get GUID of List EntityTypefullName  = https://{siteurl}/_api/web/lists/ge...

REST API to get current user of SharePoint Site/Get the data of current logged in user.

REST API to get current user of SharePoint Site/Get the data of current logged in user. _spPageContextInfo.webServerRelativeUrl/Site URL + "/_api/web/currentuser" OR If you are using the SharePoint 2013 then you can use below details to get the data of current logged in user. _spPageContextInfo.userDisplayName // It will give the Name of the User _spPageContextInfo.userEmail //  It will give the email of the User _spPageContextInfo.userId // It will give the User id of the User _spPageContextInfo.userLoginName // It will give the User Name/email of the User _spPageContextInfo.userPrincipalName //  It will give the Primary name/user name of the User

How many items can we get from a SharePoint REST API of Projectdata for Task?

Image
 Items we can get from a SharePoint REST API of Projectdata for Tasks of Project guid 300 items we can get by a SharePoint REST API of Projectdata for Task of a Project. We add a guid of a PWA Project in below REST API. and run on SharePoint page which has jquery on it. function getTaskNameWithOutLine(callback) {   $.ajax({     url: _spPageContextInfo.webAbsoluteUrl+"/_api/ProjectData/Projects(guid'7fd88051-a185-e811-80ce-00155dbca01a')/Tasks?$Select=TaskName,TaskOutlineNumber",      headers: {       Accept: "application/json; odata=verbose"      }    }).success(callback); } getTaskNameWithOutLine(function(data){ console.log(data); }); Final output is shown in below imag e Note that _spPageContextInfo.webAbsoluteUrl will work on SharePoint Online Classic Pages and it will give the absolute URL of Current SharePoint(SP) website