1

I am writing a REST query to retrieve data from child parent list.

States is the parent list with "Title" column. LocalGovernment is the child list with "State_Territory(InternalName) and State / Territory(Display name)" as a lookup column.

Following is the output without any filter enter image description here

I am trying to get "title" of the state from the parent list.

Query = /_vti_bin/listdata.svc/LocalGovernmentAreas?$select=State_Territory/Id&$expand=State_Territory/Id

Type 'Microsoft.SharePoint.DataService.LocalGovernmentAreasItem' does not have a property named 'State_Territory' - I am using "State_Territory" because it is the internal name.

I have also tried

/_vti_bin/listdata.svc/LocalGovernmentAreas?$select=StateTerritory/Id&$expand=StateTerritory/Id

but error is

Only properties specified in $expand can be traversed in $select query options. Property

I have also tried

/_vti_bin/listdata.svc/LocalGovernmentAreas?$select=State_Territory/Id&$expand=State_Territory

but error is

Type 'Microsoft.SharePoint.DataService.LocalGovernmentAreasItem' does not have a property named 'State_Territory'

3

The error:

Only properties specified in $expand can be traversed in $select query options. Property .

occurs since it seems the $expand query option syntax:

$expand=<lookupfield>/<projected property> is not supported in SharePoint 2010 REST Interface.

Solution

Use the following query instead:

/_vti_bin/listdata.svc/LocalGovernmentAreas?$select=State_Territory/Id&$expand=State_Territory
  • that too did not work, original question updated with query and error. – Ali May 18 '15 at 23:36
  • 1
    "StateTerritory" without underscore worked. it is not internal nor display name but worked. – Ali May 18 '15 at 23:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.