REST API
6 TopicsSharePoint Online - Issue with REST API call on a List exceeded the threshold limit
I have a List in a SharePoint Online site collection which has exceeded 5000 items.I have indexed the columns that are needed in the REST API filter query during list creation itself. Below is the Rest API query I use to fetch the data from the list. https://sptenant.sharepoint.com/sites/spfxqaw44/_api/web/lists/getByTitle('Announcements')/items?$top=4999 &$filter=(Expires ge '2022-12-06T18:30:00.000Z') and (RecordDate le '2022-12-06T18:30:00.000Z') and IsActive eq 1 and WorkflowCompleted eq 1 &$select=Id,Title,Expires,ShortDescription,Created,RecordDate,Attachments,LangTrans&$expand=AttachmentFiles&$orderby=RecordDate desc The above query gave me an error as threshold limit exceeded. So I have created a simple list and made a API call as below, https://sptenant.sharepoint.com/sites/testsite/_api/web/lists/getByTitle('LoadTestList')/items?$filter=Titlene 'Load Test'&$top=4999 Generally the return data count should be 4999 but I am able toget only 4970 items as response data. Also this response count is unpredictable, for some other lists I got response count less than 4000. Any idea on this inconsistent behavior?6KViews0likes2CommentsREST API removes HTML markup from plain text MLoT
There is an MLoT field, set as Plain Text (not enhanced not RTF), that is retrieved using REST api ajax call. The data actually contains "< a href="https://... etc">This website< / a >", but when the REST data is returned, the HTML markup tags are removed. So, in the example above only "This website" gets returned. Is it possible to return ALL of the text from the field, without getting the < a > < / a > stripped of it? Steve Clark1KViews0likes0CommentsWhile creating SharePoint group using Rest api, getting Microsoft.SharePoint.SPException with Error
Actual Error: body : "{"error":{"code":"-2146232060, Microsoft.SharePoint.SPException","message":{"lang":"en-US","value":"Exception from HRESULT: 0x80131904"}}}" statusCode : 500 statusText : "Internal Server Error". Scenario:Actually In SharePoint online, By Rest API, My SharePoint Hosted app will create new list item and following that, create two groups, group 1 created successfully, while creating group 2 getting this above mentioned general error: 500 Internal server error. Sample Code: var metadata = JSON.stringify({ "__metadata": { "type": "SP.Group" }, "Title": "Group2 Members", "Description": "Group2 Members", "OnlyAllowMembersViewMembership": false, "AllowMembersEditMembership": true }); var url = CG_AppWebUrl + "/_api/SP.AppContextSite(@target)" + "/web/SiteGroups?" + "@target='" + CG_HostWebUrl + "'" executor.executeAsync({ url: url, method: "POST", async: false, body: metadata, headers: { "content-type": "application/json; odata=verbose", "accept": "application/json; odata=verbose" }, contentType: 'application/json', success: function (data) { callback("Created"); }, error: function (data) { callback("Error"); } App has Full Control permission in Site collection, Web and List. Executing User has Site collection admin access. Note: This issue is not coming continuously, Randomly it is coming for different users with different roles. Early I thought error occurred due to permission issue for different users, but now site collection admin user also getting this issue. And also I try to reproduce the issue by sending long group name, empty string in group name, same group name which gave for group 1, but the issue is not reproducing. Anyone please give some alternate idea to reproduce the 500 internal serve error in SharePoint Hosted app. Thanks in advance.1.8KViews0likes0CommentsRetrieving list data from multiple sub-sites using same site content type with JavaScript
Dear all, I'm running a SharePoint site for projects where every project is created as a sub-site with a number of lists. Each sub-site has a list with one list item including the most important project data. This list is using a Site Content Type. I'd like to pull the data from all those lists and write it to one list on the parent site, e.g. by a weekly run of a workflow or manually. Can this task be done by using JavaScript, Rest API, etc.? Has anybody done something similar? Thanks for your tips.1.8KViews0likes2CommentsBest JS framework(Angular/React/Vue) to use in SharePoint 2013
Hi, We have tools (Basically CRUD operations in multiple lists across sites/site collections. Handles large amount of data and has lots of business functionalities/logic) that were built using jQuery and Datatables.js. We are planning to rebuild in 2013. Visual Studio/ server side coding is not allowed. Can anyone suggest which JavaScript framework (Angular Js1.x, Angular 2+, React, Vue/ Others) is best to use in SharePoint 2013? Difficult to get Node.JS/NPM/CLI on DEV environment. we have tried a PoC in Angular 4 using SystemJs-Manual mapping concept. But not sure how bundling and future upgrade will be if CLI/NPM is not used. Any suggestions please? Thanks, Puli2KViews1like1CommentAdd two content types via REST
Hello, I am trying to add two content types to a library via REST. I am sending two REST requests. For each content type, my code looks like this: fetch(SiteURL + "/_api/web/lists/getbytitle('" + libName + "')/ContentTypes/AddAvailableContentType", { method: "POST", body: JSON.stringify({ "contentTypeId":"xxxxxx" }) }) When I run the code, only one of the two content types gets added. Separately, both work. What am I missing? Side question: does PnP js core have a method for adding content types?1.2KViews0likes0Comments