I am trying to filter the files in a document library folder by file type and using the below API call for it. But the filtering doesn't work and it returns files with all the file types regardless of the file type filter used.
http://sharepointUrl/_api/Web/GetFolderByServerRelativeUrl('/Shared%20Documents/garima')?$expand=Folders,Files/ListItemAllFields/FieldValuesAsText&$filter=(Files/ListItemAllFields/FieldValuesAsText/File_x005f_x0020_x005f_Type eq 'xlsx')
I am able to filter by file type in office 365 using the field ListItemAllFields/File_x0020_Type
.
Can someone tell if the filtering by file type is allowed for on-premises SharePoint? If yes, what is the correct way to do it.