In SharePoint Online I did the following:
- Created a folder named "FolderA" in a DocLib
- Set default column value "Division = IT" on "FolderA" through library settings
- Renamed "FolderA" to "FolderARenamed"
I would have expected that in the default column value settings for "FolderARenamed" is now the default value "Division = IT".
In reality, the default column value setting is lost.
When I now create a new folder with the same name as the original "FolderA", this NEW folder gets the original default column value setting of "Division = IT".
I know why this happens
The default column values are stored in a file called client_LocationBasedDefaults.html in the hidden forms folder of the library. The client_LocationBasedDefaults.html references the folder by the "folder path" and not by a unique non-mutable column like "id".
<a href="/sites/Testsute/TestLib/FolderA"> <DefaultValue FieldName="Division">3;#IT|ffffffd5-bde5-4c07-bbfc-ff3223eeffde</DefaultValue> </a>
Correct would be:
<a href="/sites/Testsute/TestLib/FolderARenamed"> <DefaultValue FieldName="Division">3;#IT|ffffffd5-bde5-4c07-bbfc-ff3223eeffde</DefaultValue> </a>
This whole behavior leads to the following:
- When a folder is renamed no default values are applied anymore.
- When a folder has the same "folder path" as a previously configured folder, wrong default value is applied to this folder.
- Is this a bug?
- How could I mitigate this issue?
- I think about configuring default column values outside of SharePoint...