The Sitecore Powershell Extensions are an incredibly powerful tool for Sitecore, so much so that it is required for SXA. One of the features of SPE is Reporting. SPE PowerShell Reports offers a large variety of specific reports on Sitecore content, media, configuration, users, etc. It can find all broken links; all items with a particular template; items that are locked or stale.
What SPE PowerShell Reports doesn’t offer
- The ability to report the values of specific fields
- The ability to combine filters/conditions in one report
- The ability to have multiple starting items in one report
All of the above are core features of the Content Export Tool.
Report the the values of specific fields
One of the most common requests I have gotten from my clients is that they need to know the value of a particular field(s) on every item in a folder or of a specific template type. The primary purpose and reason for inception of the CET is to report the values of any desired field of Sitecore items.
The user can select as many fields as they want. Fields can be manually entered by name or ID (not case sensitive, but name must be exact). There is also a Browse feature which allows the user to select fields by template, or to search by field name; selecting fields through Browse ensures that field names will be spelled correctly. There is also the All Fields option, which will report the value of all fields on each selected item (excluding fields that begin with __). This is helpful if the user needs the values of all of the fields for each item of one particular template type, but is an expensive operation and has the potential to include a huge amount of unnecessary data, and so should only be use as needed.
Combine filters/conditions in one report
The CET offers some of the same reporting functionality as SPE, such as reporting all Sitecore items with a particular template. However, these options can be combined with other filters to generate much more specific reports. The CET offers the following filtering options:
- Template(s) – only select items of a specific template type(s)
- Items with layout – only select items that have a layout (i.e. pages rather than components)
- Language – only select the specified language version
In addition to those filters, there are a number of properties that can be included in a report in addition to field values:
- Item ID
- Item name
- Template name
- Linked item IDs (paths of linked items are reported by default for link, image, droplist fields etc. This option will also report the linked item ID)
- Raw HTML (paths of linked items are reported by default for image and link fields. This option will also report the raw HTML)
- Date Created
- Date Modified
- Created By
- Modified By
- Never Publish (true or false)
- Workflow State
All of these filters and property options can be combined in any combination to create highly specified and detailed reports.
Multiple starting items
The SPE Reports allow the user to specify the report root, the starting item where the scan begins. The CET offers this, but also offers the option to select multiple starting items. A user may want to get all a report on items from multiple different folders, but starting at /content/Home is an expensive operation and may include a lot of unneeded data in the report. Sure, in SPE the user could run the report over and over again for each root item, and could then manually combine all of the generated spreadsheets into one, but in the CET you don’t have to do that; you can run one single report that pulls the items from all of the specified roots and get all of the results in one single spreadsheet.
Other awesome features
In addition to filtering by template, the CET includes the option to include templates that inherit any of the selected templates.
This can be used for multiple purposes. If the user wants a report on a large number of templates that all share a common base, they can accomplish this easily by selecting the base template and checking off the Inheritance option rather than selecting each individual template and running the risk of leaving out desired templates. Additionally, a user could run a report this way if they wanted to know all of the items there are that inherit a particular template (this would be like running the SPE “Items with template” report, but reporting all of the items that inherit the selected template instead).
Another request I have been asked is to find all Sitecore items that have a word or phrase in any field. This is where the CET’s Advanced Search feature comes into play. The Advanced Search searches for the entered word or phrase in all fields (by default) of all selected items. The Advanced Search works in conjunction with the Start Item and Templates filters; the Fields filter can be used to only search for the keyword in specific fields.
Could this be done in the Powershell?
Probably; SPE is really powerful, and there’s a lot you can accomplish with the PowerShell Console. But composing the right Sitecore query, especially with a large number of conditions and filters, can be difficult for a developer let alone a regular content editor. The Content Export tool provides a user friendly, easy-to-use interface that allows the user to build out complex search conditions using simple form fields and to download that report as an Excel spreadsheet. It also provides the ability to save searches, so that if there is a report that a user frequently needs to run, they need only configure it once and then save it rather than remember how they configured it each time.
How the Content Export Tool could be incorporated into SPE
Easy! The SPE Reporting menu already has a Content Audit menu. The CET could be incorporated as a part of SPE by simply adding an item to this menu which would open the Content Export Tool window. I for one think it would be a great addition to SPE… but for the meantime, you can download it from the Sitecore Marketplace and use it as an independent tool for all of the custom content audits you or clients need.
The Content Export Tool is tested with Sitecore 6.5 – 8.2