Hot answers tagged

7

unfortunately, afaik (& tested) the REST services are only working for authenticated users. You'll need to create a bridge service calling with credentials the native ones if you want to provide that functionality but since you're authenticating your request, are you sure it's not an authentication issue ? Does the target username / password combination ...


6

According to Use OData query operations in SharePoint REST requests, Grouping is not supported. The solution, is to apply grouping for the JSON results returned from REST endpoint. Example Suppose the following function is used for getting list items via SharePoint REST API: function getListItems(url, listname, query, complete, failure) { $.ajax({ ...


6

Yes, you can expand multiple columns: /_api/web/lists(guid'<guid>')/items?$select=Title,LookupField1/FieldToBeExpanded1,LookupField2/FieldToBeExpanded2&$expand=LookupField1,LookupField2


6

In order to select User or Lookup field values the $expand operator is used (for making a projection of AnnouncedBy column with User Information List). For example, the following query https://contoso.sharepoint.com/news/_api/web/lists/getByTitle('Announcements')/items?$select=*,AnnouncedBy/Title&$expand=AnnouncedBy will return the following result: ...


6

Date and time OData functions: day() month() year() hour() minute() second() does not seem to work with SharePoint 2013 REST Service Error: The query is not valid But you could consider the following approaches. Option 1 Utilize SharePoint 2010 REST endpoint: /_vti_bin/listdata.svc/ListName?$filter=month(<DateColumn>) eq <MonthNumber> ...


5

As far as I know it is not supported to apply $filter or $select expression for the endpoint: http://<sitecollection>/<site>/_api/web/lists(listid)/getItems(query) To summarize: CAML and OData query could not be combined. From another hand, since expanding of User Fields is not supported in CSOM/REST i would suggest to construct your ...


5

This took forever to figure out, but of course it is simple once you got it. Instead of pasting a bunch of code, here is the context and then the raw HTTP POST request that I ended up with. The documentation is actually right here: http://msdn.microsoft.com/en-us/library/dd962796(v=office.12).aspx Syntax for the slug header is as following: ...


5

Choice fields are returned with a Value without the need for expansion: Example: IP_WorkflowStatus = IP_WorkflowStatusValue Here is an example of a query without using expansion: $filter=IP_WorkflowStatusValue eq '2-Validated' If you want to use expansion, then you need to use expanded field notation Relation/Field: $filter=IP_WorkflowStatus/Value eq ...


4

Currently $skip query option is not supported in SharePoint 2013/Online. According to Use OData query operations in SharePoint REST requests: The $skip query option does not work with queries for SharePoint list items. But you could utilize $skiptoken query option to return paged results as demonstrated below. Format: ...


4

Having worked with & built similar stacks for extending/integrating SharePoint with external LOB systems, I can say our approach has been to attack it from the other end. That is, rather than trying to use the BCS to connect to an on-prem DB, we'd create a RESTful WCF service that ran on-prem alongside the DB (could be OData as well if based off a ...


3

You will need the Id of the Employee whose children you want to fetch. Syntax: https://[My SharePoint]/_api/web/lists/MyList/items?$select=ChildName&$expand=FieldValuesAsText/Employee&$filter=Employee eq 1 This will return the 'ChildName' field of all items in which the user with Id 1 occurs in the 'Employee' field Update: For getting the Id of ...


3

I have various parameters for testing ODATA API And have tested: "_api/Web/Lists/getByTitle('Documents')/itemcount" result: Is equivalent of "_vti_bin/ListData.svc/Documents/$count" the result is fast and immediate: with this "/_vti_bin/ListData.svc/listname?$inlinecount=allpages" add to result as field called "count", see image below: You can ...


3

It is not supported for multiselect fields (i.e. fields represented in the normal UI as check boxes). The following quote is for 2013 but the same rules apply for the ListData.svc. You can filter on the client side, though, depending on how you represent the data and the controls you use. Queries for multi-value lookup fields and users Because ...


3

I see the same issue on SP2013 online with the new OData V3 _api endpoint. For CRUD operation it might be better to use the OData v2 listdata.svc endpoint for the time being.


3

The $skip parameter does not work in SharePoint 2013 for list items. It only works for collection of data (like list collections, ecc..). See my comment at the end of this article: http://msdn.microsoft.com/library/d4b5c277-ed50-420c-8a9b-860342284b72.aspx


3

You are missing ID in expand. The query should look like: _api/Web/Lists(guid'id')/items?$select=Id,Author/ID&$expand=Author/ID&$filter=(Author/ID eq 21)


3

Try adding following in the URL $select=AnnouncedBy/Id,AnnouncedBy/Title,*&$expand=AnnouncedBy Reference: SharePoint 2013–retrieving the lookup value of User fields using the REST API Getting User Information with the SharePoint 2013 REST API


2

Remove the "eq true" from your query. http://server/site/subsite/_api/Lists/getbytitle('SomeList')/items?$filter=startswith(Title, '[%Variable: StringToMatch%]')


2

The syntax of your query seems correct. Most probably this error occurs since $select and $expand operators are case-sensitive. Try the following query: /_api/web/lists/getByTitle('Customer')/items?$select=Parent/Title&$expand=Parent


2

According to OData specification: The syntax of a $expand query option is a comma-separated list of Navigation Properties. Additionally each Navigation Property can be followed by a forward slash and another Navigation Property to enable identifying a multi-level relationship. In your example, List Item resource does not expose RootFolder ...


2

Issue got resolved after updating the SQL 2012 Server(PowerPivot) version to SP1 and changing the account for SQL Server Analysis Services (PowerPivot) to Local System account. Also, the service account used for the Excel Services Application needs to be set as an Analysis Services administrator. MSDN reference link


2

Since AssignedTo is a multi-user field, you'd receive an array. You can then loop into the array and receive specific properties such as title or id. Make sure the properties are in the $select. See the example below: var call = $.ajax({ async: false, url: _spPageContextInfo.webAbsoluteUrl + "/_api/Web/Lists/GetByTitle('Tasks')/items" + ...


2

Since the original query: $filter=Created ge datetime'<startdate>' and Created lt datetime'<enddate>' includes all the items that have been created between startdate and enddate the following query in opposite excludes items that have been created in this date interval: $filter=Created lt datetime'<startdate>' or Created ge ...


2

You can create an External List using that feed. First create an External Content source using SharePoint Designer. Then use that to create the List.


2

Unfortunately, the REST API with Javascript will not give you the recurring calendar items. If you want to retrieve the recurring calendar items with client side code, you need to take a look at SPServices: http://spservices.codeplex.com/ Take a look at this thread: http://spservices.codeplex.com/discussions/254560


2

When updating a list item you should use the uri from the metdata of the list item you want to edit results[i].__metadata.uri. $(document).ready(function () { var defaultClient = OData.defaultHttpClient; var spClient = { request: function (request, success, error) { request.headers = { "Accept": "application/json;odata=verbose", ...


2

The following SharePoint REST query could be used to retrieve content type names and accompanying field names: /_api/web/contenttypes?$select=Name,Fields/InternalName&$expand=Fields/InternalName


1

It looks like you are missing WCF Data Services 5.0 for OData V3. Install it from here and reset IIS (may have to restart your machine): http://www.microsoft.com/en-us/download/details.aspx?id=29306 I have seen this happening on dev machines having both Visual Studio 2012 and 2013 running side-by-side, and then uninstalling VS 2012 and related components.


1

If I understand you correctly you need ListName or ListGuid of Lookup field ? You can get it from /_api/lists/getbytitle('list1')/Fields - here you find Author Lookup field and Guid of list you are looking for. Inside of Field XML you get this, like in my example: <d:LookupList>{5cc890cb-1974-4142-9939-c41c2539e03e}</d:LookupList> To get ...


1

If you want to do this as a single request, then I suggest you take a look at the search API. The way you are doing it, won't be manageable, if possible at all unless you are able to do it with Macros and an iterative approach. http://msdn.microsoft.com/en-us/library/office/jj163876%28v=office.15%29.aspx Using this you can filter by URL, Current Site, ...



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