Mavention Anniversaries available in the Office Store

Mavention Anniversaries available in the Office Store

As pointed out in my previous post about the Mavention Birthdays building apps are really addicting. So while the Mavention Birthdays app was queued for approval I figured we could extend its functionality a bit by not only showing birthdays but also anniversaries. As SharePoint is providing us with a HireDate field that could (or should) be filled with the hire date for each employee we could use that information to write a query to retrieve all the anniversaries.However there is one minor thing that required us to write a completely different query instead of implementing it in the Mavention Birthdays. While birthdays are always stored with the year 2000 anniversaries will be stored using the actual date a person is hired. Therefor a query to retrieve all the anniversaries for the current (or next) month will require a query that is not bound by the year.

So that’s why we created a new app, slightly different app, the Mavention Anniversaries. The basics of this app are pretty similar to the Mavention Birthdays, it will render a list of upcoming anniversaries. Yet the underlying query is tailored to show the anniversaries for the coming and the next month (with a limit of course). Such a query can only be done using a text property instead of  DateTime property. By using a text version of the information present you can write a query that matches the current month (or the next for that matter). Lets say you have a HireDate for someone in the that is hired on 01-08-2010 (English format) this will result in a text version 2010-01-08T00:00:00.0000000Z and you can write a query that checks for part of the string. In our case: "01-". We cannot search for parameters with a – as a start since the – is recognized as a separator (or as an exclusion of the term if you use without the quotes). For that matter the "HireDate:01-" will return you with everyone that has a hire date that is in January of any year. So with that it was a matter of tweaking the query to sort correctly (using another managed property for the HireDate but as a DateTime one instead of the text version, and making sure it all looks great.

Mavention Anniversaries App example

Besides that there is also a form of badging implemented where all users will get ‘badges’ based on their anniversary. This badge indicates the length of their anniversary, and will show 1 to 5 stars. The stars are handed out based on how long the anniversary is and are matched on the following criteria: longer then 1, 2.5, 5, 7.5 or 10 years a user will receive respectively their 1 to 5 stars.

In order to leverage the SharePoint 2013 Search you will have to do some manual configuration, so when you install the app you are asked to complete these steps before you will be able to see results. The steps differ between slightly between Office 365 and on premise: 

If you installed this app on-premise you need to complete the following configuration steps:

  1. Make sure you have a few profiles with hire data
  2. Go to your Search Service Service Application and click Manage Search Schema
  3. Click the New Managed Property link
  4. Name the new property HireDate, and make sure to make it of Date and Time type
  5. Check the boxes for Searchable, Retrievable and Sortable (active)
  6. Then click the Add a Mapping button, search for SPS-HireDate and select the People:SPS-HireDate property
  7. Click on the OK button to commit the changes
  8. Click the New Managed Property link
  9. Name the new property HireDateText, and make sure to make it of Text type
  10. Check the boxes for Searchable, Queryable and Retrievable
  11. Then click the Add a Mapping button, search for SPS-HireDate and select the People:SPS-HireDate property
  12. Click on the OK button to commit the changes
  13. Make sure you have a few profiles with hire data, and that the Everyone option is selected for HireDate property

If you installed this app in Office 365 you need to complete the following configuration steps:

  1. Make sure you have a few profiles with hire data
  2. Go to your Search Service Service Application and click Manage Search Schema
  3. Search for RefinableDate01 and from the context menu select Edit/Map property
  4. Add an Alias called HireDate
  5. Then click the Add a Mapping button, search for SPS-HireDate and select the People:SPS-HireDate property
  6. Click on the OK button to commit the changes
  7. Click the New Managed Property link
  8. Name the new property HireDateText, and make sure to make it of Text type
  9. Check the boxes for Searchable, Queryable and Retrievable
  10. Then click the Add a Mapping button, search for SPS-HireDate and select the People:SPS-HireDate property
  11. Click on the OK button to commit the changes
  12. Make sure you have a few profiles with hire data, and that the Everyone option is selected for HireDate property

After you have completed the steps listed above you will need to do a full crawl for the changes to take effect. If you installed this app in Office 365 you will either have to create a ticket to request a full crawl, or wait up to a week before results will show up.

You can find the Mavention Anniversaries in the Office Store, or checkout all Apps by Mavention.

Tip: Use the Mavention Profile Completeness to encourage users to keep their profile up-to-date, and show your users the latest birthday information with the Mavention Birthdays!

There are 9 comments for this article
  1. Fellipe Vieira at 16:32

    Hi, I've tried to set up a managed property so I could associate it to SPS-HireDate, but when I searched for this property to set the mapping, it didn't show up on the list. I followed the above steps and I filled one profile with some valid date, but then when I searched for this property (SPS-HireDate), it just does not shows up in the result list.
    I am using Office 365 and I already have had set up another managed property (SPS-Birthday) with no difficulty.

    Does anyone could help me?

    • Albert-Jan Schot at 17:13

      Please make sure you have at least one account that has the hiredate populated with some info. Without that the crawler won't pick it up. After you provided it in an account it can take up to 7 days before it is present in the index though.

      • Ronnie Schiller Johnson at 17:49

        This does not work in Office 365. It appears that the managed property is using the full date, and not just the Month/Day part of the date. Therefore, unless a person was hired on this day, in this month, and this year, the web part does not acknowledge the anniversary.

        • Albert-Jan Schot at 17:58

          It is correct that the HireDate is stored in a full date format. The full date format would be MM-DD-YYYY, and the query we fire is based month only, not using year or days. The actually query text is something like: HireDate:MM-* thus should return everything in the current month.

          If you are having problems could it be that your tenant is not using the MM-DD-YYYY format? So far we haven’t seen any tenant that is using another format but you never know.

  2. Joe Collins at 20:23

    I'm having similar issue as Ronnie but with the Birthday app. I was able to configure the bday app just fine, I have several profiles with dates but nothing displays in the app, not even an error message.

    The problem with Anniv app is that now I am unable to actually modify the RefinedDate01 property. I can view it, but it's greyed out so I can't edit but I do have Full Control and Owner permissions. Unsure what to do now…

  3. Joe Collins at 21:39

    Evidently it does have something to do with my access to the Admin center, even though he checked that I have Full Control… but my coworker was able to access and we go to the Mapping step and there was no "People:SPS-HireDate" to map to. It doesn't exist.

    Could that be because we don't have that field in the staff profiles?

    • Albert-Jan Schot at 20:39

      If there is no SPS-HireDate no profile has a hiredate filled in. Once you populated at least one profile with a hire date it can take up to seven days before it shows. If it shows up you can use it :-).

  4. Tupalee at 00:33

    I'm having issues with the HireDate as well. I've verified that the RefinableDate01 (HireDate) and the HireDateText are setup per the instructions. I've also verified that I can pull information back.
    – using O365
    Sample:
    HireDate: 2/28/1977 12:00:00 AM
    HireDateText: 1977-02-28T00:00:00.0000000Z

    I've also tried querying HireDate:03- and I get results for Feb, Sep, Nov… not Mar

    Any help is appreciated.

    • Albert-Jan Schot at 07:22

      Can you check the HireDateText:03 and see what that returns? If not, send an e-mail to the address on the about page of the add-in and ill gladly plan a remote session to solve the issue.

Leave a Reply