Replicate Document Library Views with SPServices?

May 14, 2014 at 7:02 PM

SPServices has been a wonderful tool for displaying list data in non-Sharepoint list formats. But I would like to know if SPServices is able to display a View from a Document Library.

I find SharePoint 2013 to be very frustrating at times... and this would alleviate at least one use case. For example, in our root site we have an "All Documents" page, which is a Web Part Page that houses several document library views from throughout our site collection. The problem with using a Document library Web Part view is that if the library is updated, the Web Part View never updates automatically (really SharePoint, why?). IF I could replicate this a Document Library view using SPServices, then I would know that both views are pulling from the same source.

Are there any simple examples of this on this site?
May 14, 2014 at 7:10 PM
Document Libraries are just lists with different capabilities, so you can absolutely use SPServices and GetListItems.

It doesn't make sense that your List Views aren't updating, though. What Web Part are you using?

May 14, 2014 at 7:50 PM
I have this situation occurring with the "All Documents" example I mentioned above. It is a Content Query web part which pulls the files from a subsite's document library. It seems to be up to date when implemented, but not updating any changes made afterwards...

With SPServices, which fields would I need to look for in order to get the link to the file?

Thanks for your help!
May 14, 2014 at 9:48 PM
CQWPs do live queries, so it doesn't make any sense that they aren't updating. Do you have some sort of caching going on?

There are plenty of examples here in the discussions, but the column you'll probably want is FileRef.

May 14, 2014 at 11:17 PM
Edited May 14, 2014 at 11:17 PM
I see. I believe this may be related to some configuration issues we are aware of, one of them having to do with the Crawler service...
Perhaps getting to the root of these issues will fix this issue we're having.
May 15, 2014 at 1:56 PM
The CQWP doesn't rely on indexing, so I'm not sure where your issue is. However, you're right that getting to the bottom of this may have a large, positive impact on site performance.