I have a list, call it Questions, that has a multi-lookup to another list, call it Answers. To get a single question by Id with its Answers, my query would look something like this...

$filter=Id eq 1&$expand=Answers&$select=Answers/Title

Now lets say I add an optional text column to the Answers list called Category. I would also like to include Category in my original query, so I update it to...

$filter=Id eq 1&$expand=Answers&$select=Answers/Title,Answers/Category

So far so good. Now to test my work...

  • Associate one or many Answers that all have a Category with a Question. Passed.
  • Associate one or many Answers that all do not have a Category with a Question. Failed.
  • Associate one or many Answers with a Question. Some have a Category and some do not. Failed.

The REST query returns the following error:

<m:error xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
  <m:code>-2146232832, Microsoft.SharePoint.SPException</m:code>
  <m:message xml:lang="en-US">
    Cannot get value for projected field Questions_x005f_Category.

I have found no documentation that specifies that the selected property of the expanded entity cannot be null.


Is there a workaround? Can you explain what SharePoint is doing that would make this fail? Is is documented anywhere?



Your Answer

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

Browse other questions tagged or ask your own question.