1

I am doing a REST query on a list. The list is a Wiki Page library - I assume that's a reason for my issues.

When I call the REST query on the list, i see all the items in the list being returned, but the fields (columns) are an odd collection of fields. For instance, the Name field is not being returned. Screenshot of returned fields below. Some fields are missing.

enter image description here

I do not know how to begin going about my issue so I can get all the fields. Any help would be greatly appreciated.

REST query below

$.ajax({
        url: _srv + "/_api/web/lists/GetByTitle('DesiredList')/items?select=*",
        method: "GET",
        headers:  {"Accept": "application/json; odata=verbose" },
        success: function (data) {//do stuff}
)};

EDIT: Here is some columns that i see on the items of this list when I look at it in the regular list view - enter image description here

2
  • The attribute "Name" is a lookup column? Your query is OK, it should return all columns of the current list. But if you want to return any attribute of another list, you will need to use $select=LookupName/AttributeName and then $expand=LookupName Jul 28, 2017 at 20:42
  • Thank you - name is not a Lookup column. It is just regular column, single line of text like Title field. Jul 28, 2017 at 20:50

1 Answer 1

1

My understanding of it is that for document libraries SP has some data in the document library and then another list which holds most of the metadata. I recently had something similar and I couldn't figure out how to keep using the _api/web/lists services. Instead I used the following endpoint

url: _srv +"/_api/web/GetFolderByServerRelativeUrl('<url for library>')/Files"

This will return all the file-y properties like Name. Then for the list-y properties I used

$expand = ListItemAllFields,
$select = ListItemAllFields/Id,ListItemAllFields/Title, ... etc.

EDIT

Okay something I suggest might work didn't. But this might help. I called

/_api/web/lists/getbytitle('<library name>')/Fields&$select=Title,InternalName

Then I looked through and found the following properties you might want to select

$select=*,FileRef,FileDirRef,FileLeafRef,BaseName,File_x0020_Type

Depending upon what else you are trying to get that might help?

Your Answer

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

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