jeudi 26 juin 2014

Group Items on Their Folder Name Inside a SharePoint Library


As you probably will know, folders could not be used in views to group documents. You could only group documents on their metadata.
Group Documents
Group Documents
A possible solution could be to add a new metadata field to the content type and manually add the folder name as the metadata value. It is very easy to add and requires no custom development, but it requires an extra manual step from the document creator.
This manual step can also be automated by a SharePoint 2010 Document library functionality called Column default value settings. It can be found on the document library settings page under the General settings section.
The Column default value settings enable you to define a default value for a metadata column per folder.
Default column value
Default column value

Approach

  • Go to the document library settings;
  • Create a new column called: Folder name (Single line of text);
  • Click on Column default value settings under the General settings section;
    Culumn default value settings
    Culumn default value settings
  • On the left side you will see your folders, and on the right site the columns for which you could give up a default value;
    Folders, columns
    Folders, columns
  • Click on the folder name, and after that on the column name;
    Default column value
    Default column value
  • Click Use this default value, and fill in the folder value and click OK;
  • Repeat this process for each folder.
Now when you upload a document to a folder, the Folder name column will automatically get the default value.
To prevent users being able to fill in their own value, you could hide the Folder name columnfrom the new and edit forms.
Hidde column from forms
Hidde column from forms

Result

Group by on folder name
Group by on folder name

Attention: SharePoint Foundation

The Column default value functionality is not available in SharePoint Foundation.

Missing “Destination folder” on upload document form

When uploading documents into a document library with folders, you normally see the following screen:

Problem On one of our sites the Destination Folder was not available. After some investigating I found that the site where it didn’t work, was created using the “Blank site” template. 
Solution Since we used the “Blank site” template, some features do not get activated by default.
I found out that the feature that is responsible for the “Destination Folder” is the “Metadata Navigation and Filtering”feature.
image
After activating the solution, the Destination Folder became available. Note that if you turn this feature off, existing libraries will be able to select a destination folder, as where newly created document libraries will not be able to use this feature.