I have a list in Sharepoint 2010 that has a folder content type, and detail content type within each folder created. I would like to be able to create some views where a user could see all detail items assigned to them regardless of which folder they are in. I can do this, but there is no column I can find that will show which folder each item is in when looking at a view of items across folders. I notice if I export the list to Excel, there is a Column added to the export result called "Path" that has the exact information I'm looking for. However, I can't find that this is an available column anywhere I can see on the site. If it can export it to Excel, why can't I see it in the list itself and add it to a view? Any way to get this information, preferably without having to create a workflow?
2 Answers
"why can't I see it in the list itself and add it to a view?" That has always been a great question!
You can create a custom code Event Receiver that gets the folder name and copies it to a text column.
I don't have access today to a SP2010 farm to test this, but I think you can also get the folder name from a SharePoint Designer workflow. It also would copy the folder name to a text column.
You should also be able to customize the view from SharePoint Designer and add the column to the view's web part. If not a displayed option, it can be added by editing the XLST code.
Steps using SharePoint Designer 2010 to add "Path" as a column.
- Create a view with the "Show all items without folders" options selected. (Not required to show the Path, but I think that's what you want.)
- Open SharePoint Designer 2010 and the Site.
- Click Lists and Libraries and click the library.
- On the right, click the View's name
- At the bottom of SPD make sure "Design" and not "Code" is selected.
- Click in the web part.
- In the ribbon click "Options" and then "Add/Remove Columns".
- Add the "Path" column.
- At the top left of SPD click the save button (disk).
- Test in your browser.
You could also add a Calculated Column to remove the site and library parts of the Path.
-
Appreciate the quick response. Could you elaborate or point me to more detailed explanation somewhere for how to do the last option?– CwagnerCommented Sep 20, 2018 at 19:52
-
If you can wait a day or two... I'll need to create a test of that example, adding the folder name, and probably won't be able to get to a SP2010 server until tomorrow or the weekend. Commented Sep 20, 2018 at 20:50
-
-
-
Hi. Short answer... If path, and not just the folder name, is what you need then it looks like it can be done. I'll update the answer above. Commented Sep 26, 2018 at 1:26
The solution Navigate to the document library you wish to show the folder path for. Add a single line of text column to the document library > give it a name (I called mine FolderPath) Under the ellipsis, press Automate > Power Automate > Create a flow.
Hope This Works, Peter