Showing posts with label RestApi SharePoint. Show all posts
Showing posts with label RestApi SharePoint. Show all posts

Thursday, March 18, 2021

18 Mar

How to read more than 5000 items from document library in SharePoint RestApi?

First call a ajax function with parameters "/_api/Web/Lists/GetByTitle(ListName)/Items?$orderby=Id desc&$top=1". Now you will get the latest added "Id".Now Divide the Id returned by the ajax by 5000. (Id/5000) So that you will get a result of how many times you need to perform the ajax.Now you can perform the ajax...

Wednesday, March 17, 2021

17 Mar

How to check whether the current user has edit permission for a particular list using JSOM in SharePoint 2013

 we first need to get the login name of user and pass it to the get_effectiveBasePermissions method.To ensure that user has edit permission, we will check the SP.PermissionKind.editListItems enum.SP.SOD.executeFunc('sp.js', 'SP.ClientContext', function () {    getCurrentUserPermission();});function getCurrentUserPermission(){ ...
17 Mar

How to get permission of a SharePoint list for a user using RESTApi

 Use EffectiveBasePermissions to get permissions of the user on a list. Example:/_api/web/lists/getbytitle('L2')/EffectiveBasePermissionsNote that this will give the permissions of the logged in userfunction checkPermissions() {    var call = jQuery.ajax({        url: _spPageContextInfo.webAbsoluteUrl...

Wednesday, December 2, 2020

02 Dec

Display SharePoint list items using rest api

 <div><input type="button" id="btnSubmit" value="Get List Details" /></div><div id="divResults"></div><script>$(function () {$("#btnSubmit").on("click", function () {getListData();});});function getListData() {var fullUrl = _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getByTitle('Projection')/items";$.ajax({url:...

Wednesday, February 15, 2017

15 Feb

How to get current user group collection through Rest api in SharePoint 2013

<script type="text/javascript">     $(document).ready(function () { getCurrentUser(); });     function getCurrentUser() {         $.ajax({             url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/CurrentUser",        ...

Thursday, September 22, 2016

22 Sep

Using REST API For Selecting, Filtering, Sorting And Pagination in SharePoint List

 how to work with SharePoint list items, basically performing CRUD operations, using the combination of REST API  and jQuery Ajax. The REST URI ends with any OData query operators to specify selecting, sorting, or filtering Selecting and sorting items: $select : This ' /_api/web/lists/getbytitle('test')/items'...

Wednesday, September 21, 2016

21 Sep

what is difference between Name and Account - /_vti_bin/listdata.svc/UserInformationList,

Result: <content type="application/xml">   <m:properties>     <d:Id m:type="Edm.Int32">1</d:Id>     <d:ContentTypeID>0x010A00F8C6531A37316E499095FDC0720C4D90</d:ContentTypeID>     <d:ContentType>Person</d:ContentType>     <d:Name>peakfinders\administrator</d:Name>  ...

Tuesday, January 19, 2016

19 Jan

How to Copy List item to Another list using sharepoint designer 2013 workflow?

We can use the the REST services to move the items one to another list. Add Dictionary is a new variable  create a dictionary add Build Dictionary action Accept and Content-Type  set the values for both of them to application/json; odata=verbos add key __metadata  New item created from workflow  call...

Tuesday, January 5, 2016

05 Jan

How to delete list item using Restapi in Sharepoint 2013

SharePoint 2013,/_api/web/lists, function deleteListItem(url, listname, id, success, failure) {     // getting our item to delete, then executing a delete once it's been returned     getListItem(url, listname, id, function (data) {         $.ajax({        ...

Friday, January 1, 2016

01 Jan

Add list items restapi

function CreateListItemWithDetails(listName, webUrl, newItemTitle, success, failure) {     var itemType = GetItemTypeForListName(listName);     var item = {         "__metadata": { "type": itemType },         "Title": newItemTitle     };    ...
01 Jan

How to Update list items restapi SharePoint

function updateListItem(url, listname, id, metadata, success, failure) {     // Prepping our update     var item = $.extend({         "__metadata": { "type": getListItemType(listname) }     }, metadata);     getListItem(url, listname, id, function (data) {  ...
01 Jan

Get Single list items restapi SharePoint

getListItem("http://peakfinders",1,complete, failure); function getListItem(url, listname, id, complete, failure) { // Getting our list items $.ajax({ url: url + "/_api/web/lists/getbytitle('" + listname + "')/items(" + id + ")", method: "GET", headers: { "Accept": "application/json; odata=verbose" }, success:...

Tuesday, December 22, 2015

22 Dec

REST API OData Filter on Boolean not Working

/_api/web/lists/getbytitle('Zone%20Manager')/items?$filter=ZMgrStatus eq...

Friday, December 18, 2015

18 Dec

How to access a custom field of a list using REST

<script type="text/javascript"> SP.SOD.executeFunc('sp.js','SP.ClientContext',update); var returnedItems; function update(){ var context=new SP.ClientContext(); var list=context.get_web().get_lists().getByTitle('Documents'); var caml = new SP.CamlQuery(); caml.set_viewXml("<View><Query></Query></View>"); returnedItems=list.getItems(caml); context.load(returnedItems); context.executeQueryAsync(onSucceededCallback,onFailedCallback); } function...

Saturday, December 12, 2015

12 Dec

RestApi In SharePoint 2013

List of REST Access Points Site http://peakfinders/site/_api/site Web http://peakfinders/site/_api/web User Profile http:// peakfinders/site/_api/SP.UserProfiles.PeopleManager Search http:// peakfinders/site/_api/search Publishing http:// peakfinders/site/_api/publishing List of REST End Points The following is a...