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?
"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.