Locked lesson.
About this lesson
Add columns to an existing view and create a brand new view that filters only for documents that are relevant to a specific team.
Exercise files
Download this lesson’s related exercise files.
4.06 creating-custom-library-views - Exercise.docx61.2 KB 4.06 creating-custom-library-views - Exercise solution.docx
59.8 KB
Quick reference
Creating Custom Library Views
Add columns to library views and create custom library views to show just the content that is relevant to the team.
When to use
We create a custom library view whenever we need a quick way of looking at a list of files and folders in different ways.
Instructions
Adding Columns to a Library View
The default view in a document library is All Documents. We can modify this view and add or remove columns.
For example, we have a whole bunch of documents in the document library. Each document is owned and managed by a particular team. We would like to create a view for each team that allows them to just see the documents owned by their team and hides everything else.
In this example, we want to create a view to filter the list of documents to show only documents that are relevant to a particular team.
As there is no 'Team' column by default in the All Documents view, we need to add this column and manually assign a team to each document.
- From the document library, click Add column.
- Select Choice from the menu.
- Choose a name for the column e.g. Team.
- Add the choices: Team 1, Team 2, Team 3, and Team 4, etc.
- Set a default value of Team 1.
- Click Save.
Now we need to edit the view and assign a team to each document in the library.
- Click Edit in grid view from the horizontal menu.
- Click in the first record, in the Team column and choose a team from the pick-list.
- Repeat this process for each document in the library.
- Once complete, click Exit grid view.
Default Values in Libraries
- From the document library, click New.
- Select Word document.
- Type some test text
- Click on the document title and rename the document to something meaningful.
- Close the file
Notice the default value of 'Team 1' has been assigned to the document in the Team column.
Creating Custom Library Views
In this example, we are going to create a new custom view using a filter to only show the documents that are tagged with 'Team 2' in the Team column.
- From the document library, click All Documents.
- Click Create a new view.
- Name the view 'Team 2' and click Create.
Now we have created the view we need to define the parameters for the view. In this case, we only want to see documents that are tagged with 'Team 2'. For this, we will use a filter.
- Switch to the 'Team 2' view.
- Click the drop-down arrow and select Edit current view.
- Scroll down the page to the Filter section.
- Select to only show items when the Team is equal to Team 2.
- Click on OK,
- Switch between the different views to test it out.
- 00:04 So in the previous lesson, we were talking about metadata.
- 00:08 And I explained that the column headings in your libraries
- 00:12 are essentially metadata.
- 00:14 And what we're looking at now is the standard documents library.
- 00:18 And contained within that is the basic standard, Metadata.
- 00:22 And that is the column headings, Name, Modified and Modified By.
- 00:27 But of course, we can add our own metadata by the way of adding columns.
- 00:32 So maybe my colleague is going to upload a document into this document library and
- 00:37 I want to know a little bit more information about it.
- 00:40 So basically, I want to know which team within the Microsoft 365
- 00:44 rollout project is responsible for maintaining each of these documents.
- 00:50 So I'm going to add a column into my document library.
- 00:55 And we've seen how to do this a few times before,
- 00:57 we click the dropdown next to Add column, and I'm going to go to Choice.
- 01:01 This is definitely my favorite option here.
- 01:04 I use this a lot.
- 01:06 So my column name is going to be Team.
- 01:11 The type is Choice, and
- 01:14 my choices are going to be Team 1, Team 2,
- 01:19 Team 3, and let's have a Team 4 as well.
- 01:24 Now what I'm going to do here is,
- 01:26 I'm going to set a default value, and this is going to be one of the values above
- 01:31 that appears automatically as the default value.
- 01:34 Obviously, I can change it, but
- 01:36 I'm going to choose Team 1 is going to be my default value.
- 01:39 And click on Save.
- 01:43 So now I have this new column.
- 01:45 Now remember, if you do add a new column and you already have existing documents in
- 01:50 there, you're going to need to go through and
- 01:52 assign the team to each of these documents.
- 01:56 So let's do that.
- 01:57 We're going to edit in grid view once again.
- 01:59 Now I'm not going to assign a team to the Travel folder, but
- 02:03 I am going to assign a team for the rest.
- 02:05 So let's say Team 2, Team 1,
- 02:10 Team 3, we'll do another Team 2,
- 02:16 Team 4, and another team 1.
- 02:20 I'm now going to exit grid view, and those values are going to update.
- 02:25 Now I can see there that one of them is still saying Choice 4, so
- 02:28 I've obviously missed that.
- 02:29 Let me jump back into edit the grid view.
- 02:31 And it looks like I've actually not typed in Team 4 correctly.
- 02:36 So this is just a good little thing to show because these mistakes do come up
- 02:39 frequently.
- 02:39 And so, what do I do here?
- 02:41 Let me exit out of grid view.
- 02:43 I need to modify my settings.
- 02:45 So let's click the drop-down, Column Settings, Edit.
- 02:49 And I can see, yes, it still says Choice 4 just here, let's change that to Team 4.
- 02:56 That looks a lot better.
- 02:57 Click on Save.
- 02:59 And now when I edit in grid view, I should be able to select Team 4 which I can't.
- 03:05 Let's exit the grid view.
- 03:07 I'm going to create a brand new document in this document library.
- 03:10 And just for the sake of quickness, I'm just going to do another word document.
- 03:16 And we'll just leave it blank.
- 03:18 I'm going to call this Test.
- 03:21 Click Close.
- 03:23 And after a couple of seconds, I should see this update.
- 03:26 There we go, Test.docx.
- 03:29 And take a look in the Team column,
- 03:31 it's given it the default value that I set which was Team 1.
- 03:36 Of course, if this is incorrect, I can just go in Edit in grid view, and
- 03:40 change it to the correct team.
- 03:42 Now remember, much like lists, we can also create our own library views.
- 03:46 So maybe I want to create a view that only shows me the documents for Team 2.
- 03:52 So once again, let's jump up to our views where we have all documents.
- 03:55 So I'm going to say, Create a new view.
- 04:00 I'm going to call this Team 2.
- 04:02 Click on Create.
- 04:06 The view has been created, but now I need to define my parameters.
- 04:09 So I'm going to Edit the current view, this is exactly the same as what we did
- 04:14 for lists, I'm going to scroll all the way down.
- 04:17 I could choose to deselect or select more columns, but
- 04:20 the thing I'm interested in here is using a filter.
- 04:24 So I only want to show items when the following is true,
- 04:31 so when the team is equal to Team 2.
- 04:36 Let's click on OK.
- 04:37 And now I have my different view created that's only showing me
- 04:41 the documents relevant to Team 2.
- 04:43 And now that I have that there, I can toggle between all documents and
- 04:47 just Team 2 documents.
- 04:49 So I could go through and create a custom view for each
- 04:52 of the teams if I wanted to so they're just seeing what is relevant to them.
- 04:56 So that is how you can add custom columns to your libraries and also create views.
Lesson notes are only available for subscribers.