New answers tagged

1

One reason of bad request can be existence of special character in the comment text. Sometime we just copy paste content from word/excel/pdf which also copies hidden Unicode characters which cause the bad request. If that is the case then you have to use regex to find and replace all unwanted Unicode characters.


0

One simple reason (and therefore probably wrong because you already tried this!) might be that I'm pretty sure the API requires the recipient be in the user information table of the site collection where the site resides. To verify, grant the recipient access to something in that site (you can immediately revoke it if you want). Doing that adds the ...


1

You can update the page properties using Send an HTTP request to SharePoint action like: Method: POST Uri: _api/web/lists/getbytitle('Site Pages')/items(1) Headers: Accept: application/json;odata=verbose Content-Type: application/json;odata=verbose If-Match: * X-HTTP-Method: MERGE Body: { "__metadata": {"type":"SP.Data....


1

If you are trying to save the checkbox selections in multiple-selection choice field, you need to pass the data in below format: 'Status': { 'results':['Status 1', 'Status 2', 'Status 3'] } So, for your case, try using this: var item = { "__metadata": { "type": "SP.Data.(ListName)TestListItem" }, "Title": &...


1

Part of the problem is that you are already concatenating the values of the checkboxes into a string, and then you are trying to use the jQuery .val() function on that string, which you don't need to do. From your fiddle: var q6 = selectedValues.join(','); console.log(q6); // this outputs a string, so you can see that the selected values appear to be ...


1

Use the below REST API format to fetch the comments from the sitepage, /_api/web/Lists('<sitepagesguid>')/items(305)/Comments To add a comment to the page, use the below URL, with post method /_api/web/Lists('<sitepagesguid>')/items(305)/Comments Body: {"__metadata":{"type":"Microsoft.SharePoint.Comments.comment"},&...


0

Only "< AppPermissionRequests AllowAppOnlyPolicy="true" > < AppPermissionRequest Scope="http://sharepoint/content/sitecollection/web" Right="FullControl" /> </AppPermissionRequests >" is needed. No need for tenant level permissions


1

You can also use RenderListDataAsStream function for SharePoint online. If the columns are indexed this function can return result set of more than 5000 items in single query. Microsoft Documentation Detail explanation blog for different approaches to read large list data


0

Try using this: _api/web/lists/getbytitle('listname')/items(100)?$select=Initiator/EMail,RAReviewers/EMail&$expand=Initiator,RAReviewers Above is working fine for me in case of person or group. Example: /_api/web/lists/getbytitle('TestList')/items(1)?$select=TestPersonField/Title,TestPersonField/EMail&$expand=TestPersonField Output: Below is part ...


1

@ricardo-silva provided the correct answer. Your first filter must be INDEXED and must return LESS THAN 5,000 items. Then you can apply other filters. The only other option is to collect the 500k items by packets of 5,000 items, and to then filter using JavaScript… But it represents 100 requests and it will take too much time. I'd recommend creating special ...


1

My understanding of the listview threshold is that regardless of using top query, if the first filter you are applying returns more than 5k as result you will always get the threshold error. Note that the solution provided in the reference you posted is not including any filters, same if you check the pnpjs examples of pagged items. Either you remove the ...


0

I tried the below code and it's working fine public async GetSampleListItems(ListTitle: string): Promise<any[]> { debugger; let ListCardItemsArray: ListCardListItem[] = []; let ListCardListItm: ListCardListItem = null; let resultsArray: any = []; return await new Promise<any[]>(async (resolve, reject) => { try { ...


0

Try this: Change GetListItems() function to: //here i am calling my method let sourceID = await this.GetSourceID("https://contosa.sharepoint.com/:u:/r/sites/Sample/SampleLibrary/Sample.vsdx?d=we836259ffe4b4f6c96ca6dd1118e6629&csf=1&web=1&e=B2w69d"); ListCardListItm["SourceID"] = sourceID; & use: public async GetSourceID(...


0

You should use the REST endpoint in below format using GetFileByServerRelativeUrl instead of GetFolderByServerRelativeUrl: https://{site_url}/_api/web/GetFileByServerRelativeUrl('/Folder Name/{file_name}') Example: Endpoint: https://tenant.sharepoint.com/sites/SPConnect/_api/web/GetFileByServerRelativeUrl('/sites/SPConnect/Shared%20Documents/Document.docx') ...


1

Try the use the below GRAPH API to get the last modified items (recent items) from the library, https://graph.microsoft.com/v1.0/sites/root/drives/<Library drive ID>/list/items?$orderby=lastModifiedDateTime desc Hope this helps.


1

An app registered in the root site or any other normal site will only be scoped to that site. Register the app and apply the permission XML in the -admin site for tenant-wide access.


0

You could use the below endpoint to retrieve all communication sites: _api/search/query?querytext='contentclass:sts_site webtemplate=SITEPAGEPUBLISHING'


0

I've tried the below in Power Automate, and filter seems to have worked for Publishing site. You can try replacing filter value with communication site's template id. /_api/web/webinfos?$select=ServerRelativeUrl,Title,WebTemplate&$filter=WebTemplate eq 'CMSPUBLISHING'


0

As you say, HasUniqueRoleAssignments is just a flag that tells you whether or not the item has unique permissions. In order to get the actual permission information, you would need to also expand the RoleAssignments property itself: _api/web/lists(guid'list-id')/items?$expand=File,RoleAssignments&$select=*,hasuniqueroleassignments You still might have ...


1

If first filter in your query returns more than 5000 items, you will get this error/exception. So, try adding the filter which return less than 5000 items first in filter query. For example: If status ne 'Closed' returns less than 5000 items, you should add it first in filter query & then other filters like: $filter=((status ne 'Closed') and (dueDate le '...


1

You are using wrong jQuery selectors while fetching the values from the input elements. Use this: // Fetch the values from the input elements var projectName = $('input#edit-pname').val(); var projectManager = $('input#edit-pmanager').val(); var accountName = $('input#edit-aname').val(); OR simply (if element IDs are unique on DOM): // Fetch the ...


1

Please try by removing IF-MATCH from the HTTP request header as it makes the request conditional and try it as below: headers: { "accept": "application/json;odata=verbose", "X-RequestDigest": $("#__REQUESTDIGEST").val(), "content-Type": "application/json;odata=verbose&...


0

You can get the RoleAssignments of list items using single REST endpoint in below format: <siteUrl>/_api/Web/Lists/getByTitle('List Name')/items?$select=Title,RoleAssignments&$expand=RoleAssignments This will give you user PrincipalId which you can match with current user ID in client side code (JavaScript). <d:PrincipalId m:type="Edm....


0

REST API with date range parameters works for me in SPO/SPFx. Just make sure date range is formatted correctly. Here is an example: https://MysharePoint.tenant.com/sites/siteColl/_api/web/lists/GetByTitle('myLibrary')/items?$top=5000&$Select=ID, Title, AssignedTo/Title, AssignedTo/EMail, Modified,Created&$Expand=AssignedTo/Id&$filter=(created%...


0

You can filter list items using CAML query when fetching list items using RenderListDataAsStream endpoint. You can pass the CAML query to POST API like below example: POST: https://<tenant>.sharepoint.com/sites/<site-name>/_api/web/Lists(guid'<list-guid>')/RenderListDataAsStream Body: { "parameters": { "RenderOptions&...


0

This endpoint solved my problem: _api/Web/GetFolderByServerRelativeUrl('/Library Name/Folder Name/')?$expand=Folders,Folders/Files For more information, check this article.


0

You can use an endpoint like this /_api/web/lists/getbytitle('Documents')/items?$expand=File&$select=File&$filter=ContentType ne 'Folder' It will list all files under the library.


Top 50 recent answers are included