2

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'

1 Answer 1

5

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
2
  • that too did not work, original question updated with query and error. Commented May 18, 2015 at 23:36
  • 2
    "StateTerritory" without underscore worked. it is not internal nor display name but worked. Commented May 18, 2015 at 23:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.