Column Default Value Settings based on Location in SharePoint

While it’s possible to set default values for SharePoint columns at library level at field settings, What if you want to set the default column value of a document based on the folders it’s saved? SharePoint Server / SharePoint Online provides a new feature to set metadata values based on the location!

Tips: In short, We can apply default value to specific metadata column of the document, based on the specific folder where the document is stored in a document library!

How to Set Default Metadata from Document Location?

Say, We have a document library with “Department” column and with few folders namely “Sales”, “Marketing”, “IT”, etc. as in this screen.
Set Default Metadata from Document Location in SharePoint 2013

And we want the metadata field “Department” value based on the location.

Set Column Default Value Settings in SharePoint

  1. Go to the List / Library >> Click on Settings >> List settings. In the list settings page, select “Column default value settings “.Column default value settings in SharePoint
  2. Click on the desired metadata column link of the respective folder(s)Set Column default value settings in SharePoint 2010
  3. and set the value for it

When users upload a new document to different folders, the “Department” field gets value from this setting automatically. This doesn’t change the metadata on all existing documents, BTW!

Salaudeen Rajack

Salaudeen Rajack - SharePoint Expert with Two decades of SharePoint Experience. Love to Share my knowledge and experience with the SharePoint community, through real-time articles!

3 thoughts on “Column Default Value Settings based on Location in SharePoint

  • Have used Set-PnPDefaultColumnValues to update the folder default values, it was successful.

    Set-PnPDefaultColumnValues -List Documents -Field TaxKeyword -Value “TermGroup|TermSet|Term” -Folder “Folder/SubFolder”

    However, I have noticed once it gives an error by chance (due to wrong value or from typo in CSV), then it doesn’t let me use PowerShell anymore for that library.

    Error: Set-PnPDefaultColumnValues : Index was outside the bounds of the array.

    • Naidu Kumapatla, I deleted the folder with the default value error and emptied both Recycle Bin stages, and I was able to continue with the library, but if I readd the same folder name (which had the default value error), the error returns. Clearning the default value does not fixt the problem:
      Clear-PnPDefaultColumnValues -List Documents -Field TaxKeyword -Folder “Folder/SubFolder”

  • is this possible via powershell script?


Leave a Reply

Your email address will not be published. Required fields are marked *