restsharepointsharepoint-2013

SharePoint REST: Field or property does not exist


I'm using REST to get data from a SharePoint library to display using the DataTables jQuery API. Everything is working fine, but I've got one stubborn field in this library that REST isn't able to grab.

The name of the field is "For", but the internal name is _x0046_or1 (not sure why, I didn't create the library). I've double-checked that this is the correct internal name using REST and by checking the code for my library view in Designer.

So using my REST call:

    /_api/Web/Lists/GetByTitle('SAS2')/items?$select=_x0046_or1&$top=5000

And I get back:

    The field or property '_x0046_or1' does not exist.

Anybody have any suggestions for a different way to reference this field that the REST api might recognize?


Solution

  • I did as Rohit suggested in the comments, and made the REST call without the select. It turns out that the actual internal name of the For field was "OData__x0046_or1". No idea why.

    Thanks for the helpful suggestion, Rohit!