Mike Skutta Blog

How to Run Quick Sitecore Reports Without Any Coding

2017-08-09
Mike Skutta and Alex Pershteyn

Overview

Sometimes you need to run a quick report from Sitecore. For example - find all news published between 7/20/2017 and 7/24/2017. The easiest way to accomplish it is to use built-in XPath builder tool.

XPath Builder

Step-by-Step Guide

  1. Login as admin and navigate to http://[YOUR-SITECORE-INSTANCE]/sitecore/shell/default.aspx?xmlcontrol=IDE.XPath.Builder
  2. Use Sitecore query to get content that you are looking for.
    1. http://sitecoreworld.blogspot.com/2014/09/querying-items-from-sitecore.html
    2. https://sdn.sitecore.net/upload/sdn5/developer/using%20sitecore%20fast%20query/using%20sitecore%20fast%20query001.pdf

Note: Never run this on the live site before testing locally or on qa first. Certain queries may take a while to run and could cause significant performance issues.

Samples

Here are a few queries I’ve used:

  1. Get all news published between 08/07/2015 and 04/15/2016:
     /sitecore/content/home/news//*[@__Created >= '20150807' and @__Created <= '20160415' and @@templateid = '{########-####-####-####-############}']
    
  2. Find all people created after 11/01/2016:
     /sitecore/content/home/people//*[@@templateid = '{########-####-####-####-############}' AND @__Created>='20161101']
    
  3. Find all people with first name ‘John’:
     /sitecore/content/home/people//*[@@templateid = '{########-####-####-####-############}' AND @FirstName='John']
    
  4. Find all fields with Field Fallback disabled:
     /sitecore/templates/User Defined//*[@@templatename='Template field' and @Enable Shared Language Fallback!='1']
    
  5. Find all people whose last name contains ‘Co’:
     /sitecore/content/home/people//*[@@templateid = '{########-####-####-####-############}' AND contains(@LastName, "Co")]
    

Similar Posts

Comments