0

Can I get the data (folders and files) from a Concrete View?

For example:

/sites/testSite/test/_api/web/lists/getByTitle('Document%20Library')/items
Aashirya
  • 1,021
  • 1
  • 12
  • 34
kolek
  • 261
  • 1
  • 8
  • I suppose view is based on the certain value on the column so you can filter the data with ?$filter=columnname eq 'myvalue' – SharePointer Jul 28 '17 at 22:25
  • that's the problem, there is no criteria the client wanted a specific view – kolek Jul 28 '17 at 22:28
  • What do you mean by 'view' here? – SharePointer Jul 28 '17 at 22:33
  • for example All Documents https://fud.community.services.support.microsoft.com/Fud/FileDownloadHandler.ashx?fid=b72acb42-f632-4b41-9ef2-0871dc1f93c1 – kolek Jul 28 '17 at 22:39
  • I managed to get the data using jQuery deferred and basing on https://sharepoint.stackexchange.com/a/28480/61365 I found that the only way is to use js CSOM; cannot get the data from the api, Hope that helps somebody – kolek Jul 28 '17 at 22:42

1 Answers1

0

You'd need to manually get the view and it's columns, filters, sorts, etc in one query, then manually create the next rest call.... would be easier to just use JSLink on the Document Library webpart if you want to be able to change the filter/sort/columns on the fly--it will be specific to the view of the webpart, so after setting up the jslink you can just change the view.

Mike
  • 12,186
  • 8
  • 41
  • 64