Metadata in SharePoint provides information on our files. It helps us organize our files properly and locate our files easily. In this article, we’ll learn how to take advantage of the metadata system in our SharePoint document library to categorize files.
For this example, we’ve created a folder named Expenses – BETTER. This contains different files for expense reports for different departments.
SharePoint automatically gives us a few metadata columns which are the Name, Modified, and Modified by. Modified column is a metadata about this file that tells us when it was modified. On the other hand, Modified by is a metadata that tells us who actually modified this file. Since these two columns are automatically created by SharePoint when adding our files, we can’t change or edit them.
What we can do is to add our own metadata columns.
Adding Metadata In SharePoint Documents
First, click Add column.
Users can add metadata in SharePoint through the form of columns, descriptions, and tags to their content.
There are various types of columns that we can add. For this example, we want a column where a user can choose an option. We need to add a column that represents the departments of the company like Accounting, HR, Marketing, and Sales. We can do that by selecting the Choice column.
Then, we need to provide some information for this column. We’ll name this column as Department and we’ll add a description as well.
We also have the option to change the type of this column if we want to.
Under the Choices is where we can add the options that the users can choose from. This is where we can add the different departments. Let’s add the Accounting, HR, Marketing, and Sales options.
We can also change the color of our options by clicking the color icon.
If we want to remove an option, just click the X icon.
Additionally, we can provide an option for the users to add values themselves. For now, we’ll leave this option unchecked because we don’t want users to add values by themselves.
Moreover, we can have a default value if we want to.
We can see other options by clicking the More options.
We can then choose if we want this column to be displayed as drop-down menu or radio buttons. For this example, let’s choose the drop- down menu.
The allow multiple selections option means that the user can select 2 or more departments to display. The Require that this column contains information is for forcing the user to add a department information for the files which is what we want so we’ll enable this option.
We don’t want to enable the Enforce unique values. Add to all content types option enforces this column for all document types like images, wikis, etc.
Click the Save button to save this column.
Then, we’ll see that a new metadata column named Department was now added.
Adding Metadata Value In SharePoint
Since our files are already added before creating the Department column, hovering on them will show this marker that says “Missing metadata”. This is because we’ve enabled the Require that this column contain information option on our Department column earlier. This means that every file should have a Department value.
There are two ways of doing it. One way is by clicking the ellipsis beside the file. Then click Details.
The Properties pane will appear and we can find the Department metadata where we can set its value. This is an expense file under the account department so we’ll choose Accounting.
If we hover over this file again, we’ll see that the missing metadata warning is now gone.
Refresh the page so we could see the changes we’ve made so far. As we can see, the first file now has a department value (Accounting) while the other files still require their department value.
The other way to do this is by clicking the Edit in grid view option. This option is better as it allows us to modify our metadata for multiple rows at once.
Then, just click on their corresponding Department row to select their department value.
After setting our files department value, it’ll look like this.
To exit this grid view, just click the Exit grid view option.
Now, all our files have their department value metadata associated with it.
Adding Other Metadata
We’re going to repeat the same process now by adding Expense type metadata on them. Let’s create a new metadata Choice column.
Let’s then add the name and description for this column.
This time, we’ll remove the style for the choices. Just click the Style icon and click No styles.
We’ll then add the type of expenses such as Misc, Supplies, Travel, and Meals.
Let’s enable the same options under the More options and don’t forget to click the Save button.
Go to the Edit in grid view again to add the expense type values on each of the files.
After adding their expense type values, we now have a metadata for their expense type as well.
You might notice a red dot here. Since we’ve added the Department and Expense type column as required metadata, SharePoint was able to detect that there are still files on our document library that doesn’t have their value for these metadata columns.
For example, if we go back to documents and check the Food folder, we’ll see that these files don’t have their department and expense type values yet. So, that’s the only reason for the red dot indicator. As we can see, it doesn’t make sense to add a Department and Expense Type metadata on these files because it’s not related to them.
It’s also the reason why we would want to create different document libraries for different things like a document library mainly for expenses reports, document library for only photos, and so on.
Adding A Number Metadata
Let’s now talk about how to add a metadata for numbers. For this example, we have a folder with expenses files and we want to add a metadata for the amount.
To add metadata for numbers, we can use the column type number or currency. For this example, we’ll add a new column and choose Currency.
We’ll name the column as Expense Amount and add some description.
Then, we’ll use 2 decimal places. We can set the currency format here depending on the country we’re in. For this example, we’ll use the United States currency. For the default value, we’ll set it to 0. Don’t forget to click the Save button to save the changes.
To add the metadata value easily, click the Edit in grid view.
Just type the information for each of the file under the Expense Amount column.
After adding the needed information, click Exit grid view.
Then, we’ll see the added Expense Amount metadata of each file.
We can now easily categorize our files based on expense amount by filtering this column. For example, we can filter this by smaller to larger amount or vice versa.
Our files are sorted from larger amounts first at the top to smaller amounts.
Another thing we can do with this metadata is add Totals. Just click on the column, click Totals and choose Sum. There are also other Totals here that we can use and explore.
Then, we’ll see that it added the sum of all the expenses at the bottom.
Grouping Files By Department In SharePoint
Just to show you how cool this feature is, let’s try grouping our files by their departments.
As we can see, a sum for each of the department’s expenses is provided.
If we don’t need this information and we want to remove it, just click the column again, go to Totals, and click None.
What’s nice about having these totals is when we’re grouping our files, we can see the group level totals too. Again, you can try the different Totals options depending on what you need. That’s one of the benefits of using this number metadata.
To summarize, we learned how to add custom metadata in SharePoint document libraries. Having this metadata is very useful in locating, grouping, and filtering our data. We also discussed how to add totals for the number metadata.
With this, we don’t need to open up the file just to check the expense amount or any number that is essential for us to see right away. We could just show them by adding a number metadata. This makes things a lot easier when categorizing our files.
All the best,