0

I have two lists: 'Company' and 'Customer'. In 'Customer', I have an auto look up field called 'parent'. Then I tried to use Rest to retrieve data from customer like this:

http://mysite/_api/web/lists/getByTitle('Customer')/items?$select=parent/Id&$expand=parent/Id

But the response returned error: <m:message xml:lang="en-US">The field or property 'parent' does not exist.</m:message>

What can I do to get rid of this error.

thanks in advanced

2 Answers 2

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 
1
  • Hi, It's work perfectly !But with my autocompletelookupfield it's raise the same error. Other information: the 'parent' column is the lookup field to 'Company' List and this is the autocompletelookupfield I customed, not Lookup field of SharePoint 2013.
    – tbbt
    Commented Nov 4, 2014 at 3:05
1

You should use the internal name of the fields in the query. Check the internal name of the 'parent' field, for example via PowerShell:

$web = Get-SPWeb http://mysite
$list = $web.Lists["Customer"]
$list.Fields | % { $_.InternalName }

or via

http://mysite/_api/web/lists/getByTitle('Customer')/items

If the lookup field was renamed, it might have already a different title than you need.

0

Your Answer

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

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