0

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?

1
  • x0046 is the code for a capital letter F, but I have no idea why SP would have converted that. Usually it only converts special characters and/or numbers if they are in the first position. Have you tried just For or For1? Sometimes SP adds the number after the internal name if there was already a column with that name.
    – Rothrock
    Commented Jun 21, 2017 at 22:13

1 Answer 1

1

Have you tried viewing the raw data through the browser? View your feed via http://<site>/_api/Web/Lists/GetByTitle('SAS2')/items in your browser and see what gets returned for that field. Copy that into your code.

Alternatively, you could use the listdata service (http://<site>/_vti_bin/listdata.svc/SAS2?$top=5000) which I have found a bit more reliable if you're just reading data.

1
  • I tried the first suggestion, and found the actual internal name for the For field. Turns out it was "OData__x0046_or1". Thanks!
    – Jason
    Commented Jun 22, 2017 at 17:55

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.