Forum Discussion
Document library custom column only in parent folder
Hi allanyip, the columns set are related to the view. Since the parent folder and its children share the same view, the set of presented columns will be the same.
It might not be a perfect solution, but you could create a new view dedicated to the child folders and then adjust the column formatting to provide a link in the 'parent view' to the newly created view for the child folders.
Let me know if that would work for you, and if you encounter any problems, I’ll try to create an example.
Hi Michal, Ok so yesterday I got some time put your solution to the test, but I was unable to create what you suggested. Think I'm doing something wrong.
Could you please create the example you mentioned in your post?
Thanks in advance.
--- edit ---
Or how about if I describe what I would like to have in our situation:
I'm setting up Sharepoint/OneDrive for the company that I'm working for.
In our OneDrive we have a folder called Customers, which contains folders each representing a customer. Now we would like to have a list in either OneDrive or Sharepoint with all the customers, but then labeled with either Website1, Website2 or Custom (Each customer should have at least one of the labels).
In that list we would like to have the ability to filter on the three status above.
Hope that explanation above is clear enough, if not please let me know.
Thanks in advance!
- michalkornetSep 22, 2024Iron Contributor
Hi allanyip, I didn’t have much time this weekend, but I will try to make a proper example at the beginning of this week.
- michalkornetSep 25, 2024Iron Contributor
Hi allanyip, my initial idea was to create two different views: the default view (AllItems) and a second view (SubFolderView). When users enter the document library, they will see the list of folders with the default view (AllItems.aspx).
The default behavior when clicking on a folder name is to navigate to the folder within the same view. In this case, I used column formatting to redirect the user to the folder but in a different view.
The column formatting I used:
{"elmType": "a","txtContent": "@currentField","attributes": {"href": "=@currentWeb + '/Shared%20Documents/Forms/SubfolderView.aspx?id=' + [$FileRef]","target": "_blank"}}But when I saw your description, I had another idea.
-------------------------------------------------------------------------
Maybe, as you described, you can create an additional list in SharePoint for all clients with described columns and an extra column that contains a link to the specific client folder on OneDrive.
This list could also serve as an admin list. Additionally, you can add a flow that reacts to the creation of a new item on the list and creates a new folder on OneDrive.