Office 365 and SharePoint – Calendars with Search Web Parts and Calculated Event Date Filters

We’ll step back from Contract Lifecycle Management (CLM) specifically, though it’s still relevant, and focus on a more generic business management scenario in Office 365 and SharePoint using Calendars rendered with Search web parts and calculated event date filters.

Calendars are Just a List of Events

First, to set the stage: calendars should be thought of as a list of events, not some rigidly structured artifact that needs to be presented in the classic graphical view that (I think) most of us tend to go to in our heads. That is, a calendar DOES NOT need to be presented in SharePoint like this:

Business Management O365 SharePoint default calendar view.

Actually, in most cases, I find this is the worst view of a calendar to use in SharePoint pages. It’s clunky, hard to clearly see what’s happening on a specific date, time consuming to navigate, difficult to visually customize, and so on. Actually, the content type of items in calendar lists is specifically, Event. You can see this if you create a Calendar App and navigate to list settings:

Business Management Office 365 SharePoint calendar content type.

You’ve been following the Sales team as they created the Sales Contracts Library and the Sales Contract Lifecycle Management Tasks list. You’ve also seen them create custom content types with site columns that are promoted to managed properties and made available to SharePoint search. This time, things are going to be much simpler as we see the team take advantage of the default Event content type and the fact that the Event content type’s columns are already promoted into the managed properties they need for their search web parts and calculated date filters.

A Simple Calendar Web Part with Event Date Filters

The team is only going to use the SharePoint Content Search Web Part (CSWP) at the top-most home page of the Intranet. First though, we’ll see them use the out-of-the-box Calendar Web Part to share events that are only relevant to Sales Division teams on the Sales Division home site. In this scenario, they’ll set up a Calendar list and add Quarterly Kick Off events. Then, they’ll add that calendar’s web part to the home page and filter the web part to only show events that are starting within 5 days of the current date. Now, of course, there would be more than Quarterly Kickoff events in their calendar in a real-world scenario, and as such, more than one item would be displayed in the web part as shown in the video below. For this sample/demo though, we’ll keep with the series theme and keep examples straightforward:

Create the Calendar List

With the calendar created, let’s watch the team add it to the Sales Division home page and get away from the classic calendar view to a tabular view where visitors to the site can quickly and accurately assess upcoming events.

Add the Calendar to the Home Page and Apply Event Date Filter

That’s it, nothing else is needed for the example. The main take-aways are:

  • Switch the view from “Current View” (which is a graphical calendar view) to “All Items” so we get the item-based list view.
  • Customize the web part properties to your design.
  • Edit the web part properties and limit the fields displayed in the view.
  • Of course, specify the event date filter which reads: anything where the event starts within the next 5 days.
  • Note, that filter value is [Today]+5

Important – in the effort to make a quick recording, I did not include the full filter. A filter must also be added to ensure that “Start Date is greater than or equal to [Today]“, otherwise expired events will remain on the calendar forever. The final filter is actually: Starts on a date greater than or equal today and less than or equal to five days from today:

Business Management O365 SharePoint sales team event filter.

 

It’s not hard to image how much easier this list view of events will be for visitors to read versus the clunky calendar view when there are multiple items (even just 2 or 3).

Content Search Web Part with Event Date and Other Filters

You should familiarize yourself with the following two posts if anything I write below isn’t clear:

There’s a complete explanation of all the vocabulary and highlights that I capture below in those two posts.

Here, the team is going to be adding a Content Search Web Part (CSWP) on the home page of the Intranet just as outlined in the previous posts called out above. The keys to know about these next steps are that:

  1. Our Path search term will specify that the entire site collection should be searched, and it will filter down to just the Event content type.
  2. The web part on the home page is going to combine Event(s) from every site and filter to the new Category, “Corporate”.
  3. The “Start Date” field is actually a friendly name for the Site Column, “EventDate” . The search will filter to events starting within the next 10 days.
  4. The Search Schema has a predefined managed property, “EventDateOWSDATE“, which is Query enabled and holds EventDate values of list items.
  5. The Search Schema has a predefined managed property, “CategoryOWSCHCS“, which is Query enabled and holds Category values of list items.

So, about that category: when adding an calendar event item, users can specify a custom category, and as noted above, our CSWP is going to filter on that along with Event Date. Specifically, it will filter for events tagged with the category, “Corporate”:

Now, add the CSWP to the home page of the Intranet. Here’s the query you specify in advanced mode.

Path:{SiteCollection.URL} AND ContentTypeId:0x0102* AND CategoryOWSCHCS:Corporate AND EventDateOWSDATE >={Today} AND EventDateOWSDATE <= {Today+10}

If you can’t read that query (using the Keyword Query Language, KQL) as second nature, again, go through the refiners post here. We’ll limit the number of items to show at 10, use the “Two lines” template, and set the “Line 2” property to map to “EventDateOWSDATE”. Using the “Two Lines” template and setting properties for line 2 is covered here.

Business Management O365 and SharePoint CSWP settings.

Review the Calendar Web Part and Content Search Web Part

Here’s the new Meet and Greet event on the Sales Division Page. This will show-up immediately:

Business Management Office 365 SharePoint sales division calendar.

And, after waiting for Search to complete its crawl, we see the new Corporate event (and only the Corporate event), show up on the main Intranet home page.

Business Management O365 SharePoint Corporate Events.

 

As the standard sign-off line goes: use your imagination to build out on this example. Corporate events include: training (HR Division), meet-and-greets (Marketing, Sales, and others), company holidays (HR Division), annual reviews (HR and division-by-division), and so on. Of course, each of these divisions have dozens of their own milestones to put into their calendars and render locally on their site division-or-department sites.

Advertisements


Categories: Business, Business Management, Contract Lifecycle Management, Office 365 and O365, SharePoint

Tags: , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: