Share via


group by folder name in sharepoint library

Question

Friday, November 23, 2012 1:05 PM

Hi

Is there any way to group the items based on Folder name in sharepoint Document Library.

keerthi

All replies (9)

Friday, November 23, 2012 1:31 PM ✅Answered

Hi,
I don't recall any column which stores such a information. My proposition is:

  1. create new text column A
  2. using workflow or event handlers extract folder name and put into this column A
  3. use column A in view for grouping

In my opinion for this view you should set "Show all items without folders".

Hope this will help you.

pkozan


Monday, November 26, 2012 3:35 AM ✅Answered | 2 votes

Hi keerthi,

I agree with pkozan. We can use workflow to exact the folder name from an item, and populate it in a custom column. After than, we can group the items by the custom column.
In the workflow, we can set the Item's Path value to the custom column.

But here, I would like to propose another solution. We can use the SharePoint treeview control. With the Treeview control, all folders will be displayed in the tree, then we can display item with a folder by clicking the folder name, without go back to the page again.
For more detailed on this solution, please see:
http://yetanothersharepointblog.wordpress.com/2012/08/28/adding-a-treeview-to-a-document-library-using-sptreeview-and-sphierarchicaldatasource/

Thanks,
Jinchun Chen

Jinchun Chen(JC)
TechNet Community Support


Friday, November 23, 2012 1:20 PM

Hi Keerthi,

I am wondering the advantage/use of group by folder name as in sharepoint you can not have more than one folder with same name within a library.

However you have sorting option by folder name.Which might be helpfull.

Also you have the option of document set in 2010 where you can group similar kind of documents.

Thanks

Shilpee


Friday, November 23, 2012 1:36 PM

Why would you want to use folders?  Folders make locating documents more difficult, and futhermore do not have the benefits of Metadata.  Also, it is worth remembering that as a URL gets too long because of the use of folders eventually it will stop working and cause all sorts of issues.

Meta-data is the way forward.  You could call these virtual folders for want of a better terminology.

Read this link for more information on Meta-data.

I hope this hellps.

Kind regards, Kev


Friday, November 23, 2012 1:48 PM

Hi Shilpee

Thanks for your reply

We have more than one folder in a document library and each folder has some files like docx, pdf.

So we would like to show the document library in webpart page as webpart.

So this case we would like to group the items in the folder so that each time on click of folder all the documents can be shown.

Thanks

keerthi


Friday, November 23, 2012 2:22 PM

Hi Keerthi,

You can try add the document library in the page as webpart and then under modify webpart->Edit current view and then under folder section select "Show Items inside folders"

This will provide you the document library as a webpart on the page with folder structure within that.Once you will lick on any folder it will show all documents inside that folders on the webpart itself.

Hope it helps.


Friday, November 23, 2012 2:34 PM

HI Shilpee

I agree with you and have implemented the same.

But to select the different folder once one folder have been selected on the webpart, we will have go back to the page and click on the other folder to open.

Instead i would to expand the folder name to show all the files on the same page.

Could you help me out in this regard.

Many Thanks

keerthi


Friday, July 4, 2014 7:02 AM | 1 vote

There is an easy OOB way of achieving this without treeview or workflow.

1. Create a custom column for folder name as proposed above

2. From Library Settings page, under General Settings, click "Column default value settings"

3. Then on the "Change Default Column Values" page, you will see that all folders in the library are listed on the left-hand-side. For each folder select its name, then on the right-hand-side from the list of columns select the custom column you created earlier to populate the folder name and in the dialog that opens type the exact folder name.

4. Repeat Step 3 for each folder.

After this for every document you upload in a folder, its metadata column for folder will populate automatically.

Hope that helps someone.

MAK


Monday, November 21, 2016 6:45 PM

MAK (Asif Khawaja): I'm not sure they were talking about SP2013 at the time (rather than 2010), but this is a very nice solution.  Thanks!