0
votes

When accessing a Sharepoint 2010 list via the REST service endpoint using listdata.svc:

.../_vti_bin/listdata.svc/ExpenseBudgetSubmissionRequests

The response is missing person/user fields that are defined in the list:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<feed xml:base=".../_vti_bin/listdata.svc/" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom">
  <title type="text">ExpenseBudgetSubmissionRequests</title>
  <id>.../_vti_bin/listdata.svc/ExpenseBudgetSubmissionRequests/</id>
  <updated>2017-08-17T08:03:15Z</updated>
  <link rel="self" title="ExpenseBudgetSubmissionRequests" href="ExpenseBudgetSubmissionRequests" />
  <entry m:etag="W/&quot;1&quot;">
    <id>.../_vti_bin/listdata.svc/ExpenseBudgetSubmissionRequests(1)</id>
    <title type="text">Department1</title>
    <updated>2017-08-16T11:20:29+01:00</updated>
    <author>
      <name />
    </author>
    <link rel="edit" title="ExpenseBudgetSubmissionRequestsItem" href="ExpenseBudgetSubmissionRequests(1)" />
    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Status" type="application/atom+xml;type=entry" title="Status" href="ExpenseBudgetSubmissionRequests(1)/Status" />
    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/CreatedBy" type="application/atom+xml;type=entry" title="CreatedBy" href="ExpenseBudgetSubmissionRequests(1)/CreatedBy" />
    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ModifiedBy" type="application/atom+xml;type=entry" title="ModifiedBy" href="ExpenseBudgetSubmissionRequests(1)/ModifiedBy" />
    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Attachments" type="application/atom+xml;type=feed" title="Attachments" href="ExpenseBudgetSubmissionRequests(1)/Attachments" />
    <category term="Microsoft.SharePoint.DataService.ExpenseBudgetSubmissionRequestsItem" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
    <content type="application/xml">
      <m:properties>
        <d:ContentTypeID>0x0100F434AF171BE4B04F8C760EB990D765EF</d:ContentTypeID>
        <d:Department>Department1</d:Department>
        <d:CostCentre>CostCentre1</d:CostCentre>
        <d:FinancialYear m:type="Edm.Double">2017</d:FinancialYear>
        <d:StatusValue>Unsubmitted</d:StatusValue>
        <d:Id m:type="Edm.Int32">1</d:Id>
        <d:ContentType>Item</d:ContentType>
        <d:Modified m:type="Edm.DateTime">2017-08-16T11:20:29</d:Modified>
        <d:Created m:type="Edm.DateTime">2017-08-16T11:20:29</d:Created>
        <d:CreatedById m:type="Edm.Int32">2</d:CreatedById>
        <d:ModifiedById m:type="Edm.Int32">2</d:ModifiedById>
        <d:Owshiddenversion m:type="Edm.Int32">1</d:Owshiddenversion>
        <d:Version>1.0</d:Version>
        <d:Path>.../Lists/Expense Budget Submission Requests</d:Path>
      </m:properties>
    </content>
  </entry>
</feed>

Attempted to specify person fields through the $select and $exapnd parameters but with no success. How do you access the person fields?

1

1 Answers

0
votes

Credit to this blog entry: https://thesharepointdive.wordpress.com/2014/09/17/user-field-does-not-appear-sharepoint-2010-rest-services/

The List attribute is missing from the Schema.xml, however without the right access I cannot seem to edit the Schema xml file directly.

Solution: In the list settings set the person field to choose from a user group. You can always set it back to All users afterwards but this action creates the List attribute against the field in the list schema.xml.

User fields are now present in the REST response.

list settings screen shot