Tag Info

Hot answers tagged

4

The problem with the folder name "large_files" is that it ends with the string "_files". This is a reserved name for SharePoint Online. Scroll down here http://support.microsoft.com/kb/905231 and you will see that extension listed, amongst a number of others. For a list of reserved/blocked characters in SharePoint Online check this link ...


2

I'd probably create a column (Flagged of type Yes/No) in the list to act as a field to filter on versus ORing all that together. Tick all the boxes to Yes for those items and then it becomes something like: http://mysite/_api/web/lists/getbytitle('SomeList')/items?$filter=((Flagged eq true)&$orderby=Test_x0020_Date desc&$expand=AttachmentFiles& ...


2

According to Search limits for SharePoint Online SharePoint Online search has the following limit: Limit: Number of rows in a result set Maximum value: 500 Limit type: Boundary(*) Notes: To display the entire result set, issue more paging queries Boundary - A number that can’t be exceeded Since 500 RowLimit cant be exceeded you ...


2

As Pete M mentioned above you cannot filter directly on a multi-value lookup. The workaround to this is to use a CAML query via an HTTP POST. This does have the overhead of having to get the request digest, if the list doesn't have a large number of items, it may be best just to use client side filtering. var endPoint = ...


2

EnsureUser will throw error if the username is incorrect. However, if the username is correct and is not in the site, it will make sure to add it in the site. There doesn't seem to be an elegant way of handling the EnsureUser error but to catch it. Example: try { var rootWeb = ctx.Site.RootWeb; var user = rootWeb.EnsureUser("adam"); ...


2

You could apply the following filter to exclude the fields that are not available in List forms: /_api/web/lists/getbytitle('<list title>')/fields?$filter=Hidden eq false and ReadOnlyField eq false


2

This should be it: html = html + "< a href='" + this.LinkingUrl + "' target='_blank' >" + this.Name + "</a>"


1

Hyperlink column in SharePoint REST has the following format (JSON): { Description: "Description" Url: "Url" } The following JavaScript example demonstrates how to retrieve Hyperlink column: var listTitle = '<list title>'; var webUrl = _spPageContextInfo.webAbsoluteUrl; var endpointUrl = webUrl + "/_api/web/lists/getbytitle('" + listTitle + ...


1

For lookup columns use get_lookupValue() to get the lookup information. Example: oListItem.get_item('Programs').get_lookupValue() UPDATE In case lookup field supports multiple values, use this code: //Get Multiple Lookup Field value var categoryValues = item.get_item('Categories'); for(var i = 0; i < categoryValues.length; i++) { var categoryValue ...


1

Yes, you can use REST to query a list regardless of Search and its crawl status. You can use REST to list items from any list on any site in any site collection. To view a list: <site>/_api/Web/Lists/GetByTitle('My List') or <site>/_api/Web/Lists(guid'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx') To view list items: ...


1

Sure, create the rule and use: Advanced Query Text Match Query contains one of these phrases (semi-colon separated) = Programmer On a side note you know you can also configure "Query Client Types" and give the developers an ID to pass with their query for logging and performance tuning.


1

I currently use this: var ctx = new ClientContext(site); var rootWeb = ctx.Site.RootWeb; var usr = rootWeb.EnsureUser(userName); ctx.Load(usr); ctx.ExecuteQuery(); usr will have the value for the SharePoint. SharePoint tries to resolve the user by e-mail, UPN and Name


1

To rephrase your question, you would like to filter files by file extensions. If so, then i would recommend to consider these options: Aboutendswith function According to OData query operators supported in the SharePoint REST service endsWith function is not supported Using substringof function Since endsWith function is not supported, here is an ...


1

I can resolve the issue , the prod environment is an "fr" site collection so the query should be ($filtre=) at the place of ($filter=) just write filter with fr language.


1

According the OData spec there are supposed to be operations like count and inlinecount but, as far as I've seen, they don't work with the SharePoint 2013 REST API. Your best bet is to run the query you have above and then check the length property of the array that's returned. Update: I just though of another option, using the SharePoint 2010 REST API. ...


1

The first you have to get auth cookies. The auth process you can see at the figure I don't think exists ready to use solution for this, but the following links may be useful for you: Using cURL to authenticate with Sharepoint Authenticate to Sharepoint Online/Office 365 with cURL


1

I would recommend to replace REST query,utilize CAML query instead of filter query option as demonstrated below: Endpoint: POST /_api/web/lists/getbytitle('<list title>')/getitems { 'query' : { '__metadata': { 'type': 'SP.CamlQuery' }, 'ViewXml' : query } } where query: <View> <Query> ...


1

There is nothing in the SharePoint REST API which allows you to create a file using a template. You will have to create new file (empty) or with at least one page. Then set the metadata including the contentTypeId. The following link shows how to do this without creating more than one version if you have versioning on. You can adjust the code to include the ...


1

Not supported at this time. It is on the road map. Look at "SharePoint API partial file upload support" here http://roadmap.office.com/en-us


1

The ListItemCollection does not have a files collection, so you cannot call the Add method. You can only add files to a document library by using a folder in you URL. Here is an example URL: http://site/_api/web/lists(guid 'guid')/rootfolder/files/add/(url='whatever.png',overwrite=true)


1

The following example shows how to create a file attachment to a list item: url: http://site url/_api/web/lists/getbytitle('list title')/items(item id)/AttachmentFiles/ add(FileName='file name') method: POST headers: Authorization: "Bearer " + accessToken body: "Contents of file." X-RequestDigest: form digest value content-length:length of ...


1

Here is an example that demonstrates how to query all search results using SharePoint 2013 Search REST API: function search(webUrl,queryText,rowLimit,startRow,allResults) { var allResults = allResults || []; var url = webUrl + "/_api/search/query?querytext='" + queryText + "'&rowlimit=" + rowLimit + "'&startrow=" + startRow; return ...


1

Vadim's response is very close, but his query string is off a bit. The issue isn't really his, its Microsoft's as they are not being consistent with their URI escaping. I used the Postman extension for Chrome and by examining the __next value returned when using $top (which is alternative approach worth considering) I noticed that there is an ampersand ...



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