10 votes
Accepted

AJAX/Rest only returning 100 items instead of full list

The OData provider for the REST API is configured to limit the number of items in a response to 100. It protects against developers inadvertently making a request that returns large result sets. If ...
Rob Windsor's user avatar
  • 12.6k
5 votes

How to get list items using Ajax and rest services

Here you can use any of the query but before that you must be clear with your own requirement. If you want to get data with specific parameter (like you want to filter your data) then you can use the ...
Aakash Maurya's user avatar
5 votes

Getting this error: An entry without a type name was found, but no expected type was specified

I think this occurs due to missing Type attribute in List Item entry. If you want to create list items using REST you will need to include the list item type. The list item type is a string ...
Sylvain B's user avatar
  • 260
5 votes

AJAX Pass variable to successhandler

function addList() { var something = "ABC"; getData(url).success(function(data) { successHandler(data, something); }); } function successHandler(data, something) { console....
Rob Windsor's user avatar
  • 12.6k
5 votes

AJAX Pass variable to successhandler

Robs answer works, But you might as well move the whole function inside the addList scope (unless the function is called from other functions as well) The JavaScript .bind() method is the JS way of ...
Danny '365CSI' Engelman's user avatar
4 votes

Getting this error: An entry without a type name was found, but no expected type was specified

When making a POST request, __metadata attribute isn't required if aren't passing the Accept:"application/json;odata=nometadata" header. If you are passing in a verbose header you would need to ...
Edison Neza's user avatar
4 votes
Accepted

Get item count in a list with filter

The problem is $count return a plain text not a json so you call should be change from: headers: { "Accept": "application/json; odata=verbose" } To headers: { "Accept": "text/plain;odata=verbose" } ...
Marco's user avatar
  • 1,044
4 votes
Accepted

update sharepoint list using jQuery and ajax

How to update List Item via SharePoint REST interface function updateJson(endpointUri,payload, success, error) { $.ajax({ url: endpointUri, type: "POST", data: ...
Nderon Hyseni's user avatar
4 votes

Failed to load resource: the server responded with a status of 500 (Internal Server Error)

First: To really troubleshoot the very generic "500 (Internal Server Error)" error, you'd need to get access to the server ULS logs, or attach a debugger to w3wp.exe. 500 only means a basic error has ...
Evariste's user avatar
  • 9,751
4 votes
Accepted

Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Based on the chat conversion, we have tried to trace the root cause of 500 internal server error and finally, we found out the OP has used SOAP web service, so it should return XML instead of json ...
Mohamed El-Qassas MVP's user avatar
4 votes

Getting assign to by rest

The AssignTo field is people/group field so we need to expand the field to get information from the field and in rest we need to specify the internal name of the field not the display name example in ...
Sunil Sahu's user avatar
  • 1,768
4 votes
Accepted

Rest API Post Request Returns '403 Forbidden'

You can directly use the FormDigestValue in the RequestDigest header in Modern pages. The __REQUESTDIGEST is a hidden HTML element which is not present in modern pages. So, it had tripped up your ...
Gautam Sheth's user avatar
  • 30.9k
4 votes
Accepted

How to use SharePoint REST API to get newest list item?

The URL and endpoint seems right. But in success, you will get the return data in data.d.results array. So you can extract the ID of item from data.d.results array. In this case, You will not get ...
Ganesh Sanap - MVP's user avatar
3 votes
Accepted

REST Add List Item of Custom Content Type

You don't have to deal with __metadata. Just specify your ContentTypeId in your request body and that's all. data: JSON.stringify({ __metadata: { "type": "SP.Data....
Atish Kumar Dipongkor's user avatar
3 votes
Accepted

Hide a specific list from 'View All Site Content' using JSOM/CSOM?

Try this var list = ctx.Web.Lists.GetByTitle(listTitle); list.Hidden = true; list.Update(); ctx.ExecuteQuery(); Source: Hide document library using CSOM Note that in the source they use ...
Juan Pablo Pussacq Laborde's user avatar
3 votes
Accepted

Connected Visual Webpart - RegisterAsyncPostBackControl is not working?

Credit goes to @KenHansen, Updated the code as below and it works <td> <asp:UpdatePanel ID="btApplyFilterPanel" runat="server"> <ContentTemplate> ...
Karthikeyan's user avatar
  • 2,548
3 votes
Accepted

displaying ajax query results in usable format

Ok, so I think it's a little easier to see the structure if you open your browser tools and do console.log(data.d.results) instead of alert (no need for JSON.stringify). Where you see the square ...
Dylan Cristy's user avatar
  • 12.7k
3 votes
Accepted

Corrupt or blank file when downloaded from Sharepoint using rest API ajax call javascript

As we have seen in this problem, mentioning responseType :'arraybuffer' or responseType :'blob', or using 'binaryStringResponseBody:true' didn't help. In all cases we were getting the response but it ...
UBK's user avatar
  • 1,213
2 votes

please convert following code to ajax and rest services

I have to say, I'm not a big fan of the do this for me questions, but this is a a good start to converting your JSOM to REST/AJAX. I haven't tested this, but this should be a good starting point for ...
Mike's user avatar
  • 12.2k
2 votes

how to get this error solved? error is saying ...expected identifier in function getdetails

Your code fails because the Function declaration is wrong: You do: function getdetails( {dosomething} ) But the correct way of declaring a function is: function getdetails() {dosomething} BUT, ...
Danny '365CSI' Engelman's user avatar
2 votes

Why can't my value pass through JSON to SHarepoint list?

Two things: Your metadata type is wrong. It should be SP.Data.ChangeOfAddressListListItem. The format is SP.Data.(list name)ListItem or SP.Data.(library name)Item when adding or updating an item. You ...
Rob Windsor's user avatar
  • 12.6k
2 votes
Accepted

Populate navigation menu with ajax

Finally I managed to do it with this : Sys.Application.add_load(MyLoad); function MyLoad() {...}
metraon's user avatar
  • 282
2 votes

REST + SharePoint Online: Update Single User Lookup Field to null

Make sure the user field value is specified as <FieldName>Id: null in request, for example: url: <webUrl>/_api/web/lists/getbytitle('<listTitle>')/items(<itemId>) method: ...
Vadim Gremyachev's user avatar
2 votes

XMLHttpRequest cannot load error

Browser is not allowing you to access service which is published on different domain. following is link of tutorial of how to access cross domain service. http://www.html5rocks.com/en/tutorials/cors/...
Akshay Belure's user avatar
2 votes
Accepted

AJAX get for this weeks birthdays

i'd suggest using momentjs and calculating the exact date that you need for each, then query rest based on that. somethings like var monday = moment().startOf('week').add(1, 'days'); //beginning of ...
Mike's user avatar
  • 12.2k
2 votes

REST Gel all folders/subfolders and files in tree view using Ajax

Try /_api/web/Lists/GetByTitle('Documents')/Items?$select=FileLeafRef,FileRef You will have to built the correct tree structure yourself
Danny '365CSI' Engelman's user avatar
2 votes

AJAX Rest get currency format

Whenever we are retrieving values for Currency column, it only returns its value in Numeric format but doesn't returns Currency Type. As we know a Currency column can be set to contain only one type ...
Yayati's user avatar
  • 1,728
2 votes
Accepted

Unable to retrieve list items using REST JSON (using jQuery.slim)

The issue lies with your jQuery file. Use either of the below jquery references - 1) https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js or 2) https://cdnjs.cloudflare.com/ajax/libs/...
Gautam Sheth's user avatar
  • 30.9k
2 votes
Accepted

Get document URL via Ajax

You need to add the EncodedAbsUrl field in the select fields. You can add all the fields that you want using the internal column names. So, modify your endpoint as below: url: "XXX_api/web/lists/...
Gautam Sheth's user avatar
  • 30.9k
2 votes

How to update Values in Sharepoint list using ajax

function CreateListItemWithDetails(listName, webUrl, newItemTitle, success, failure) { var itemType = GetItemTypeForListName(listName); var item = { "__metadata": { "type": itemType }, ...
SharePointMan's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible