Redirect Users if They’ve Taken the Survey

The basis for today’s blog post is regarding some work I’ve been doing with a client and the Microsoft Productivity Hub (here’s a description of it).  The Productivity Hub is great because it gives the enterprise users a one stop place to go to for self-service training on many different Microsoft products.

The client wanted to provide end users a link to the Productivity Hub in their environment, but they didn’t want to overwhelm everyone, and wanted to gradually wean them into it.  They also wanted to start out by just providing the SharePoint training modules at first, and then put the other MS Office modules later, in Phase 2, once they’re used to the interface.

I created a 45 minute video of “Introduction to SharePoint” for end users for this client (specific to their own site and environment).  A cool thing about the Productivity Hub is that it has a built in Quiz.  There are already existing quiz questions for products such as Excel and Word.  There weren’t any SharePoint questions, so I created some based off of topics I had covered in my own video.  FUN!

Then, here’s the cool part that this blog is about.  We wanted the end users to HAVE to watch my video and take the quiz FIRST before going through all the other SharePoint content in the Productivity Hub.  I created a web part and put it on the home page.  If you haven’t taken the quiz yet, it automatically redirects you to a web part page that only has my video embedded and a big button to “Take the Quiz”.

Keep in mind: This solution can be applied to ANY SharePoint list.  The concept is that you give a condition such as a certain item exists or doesn’t exist in the list, and the user gets redirected.  Therefore, this solution can be done in ANY version of SharePoint or SharePoint Online with Office 365.

This is how I did it:

In the productivity hub, there is a list called Quiz Results.  So basically, if the currently logged in user has no items in that list under the topic “SharePoint”, I want to redirect them.

    1. Create a blank web part page.

(If you’re not sure what it means to create a web part page, click here.)

  • On that web part page, put the Media web part with your video, and under that put a hyperlink or pretty image with hyperlink to fill out the quiz.  Note that the Media Web Part is only available with the enterprise version of SharePoint.
  • Insert the quiz list web part on your homepage, and set up a filter so that the Created By field equals [Me], and in my case I also added AND Product is equal to SharePoint.
  • In the web part toolpane, in the Layout section, check the box next to Hidden.
  • Open this page in SharePoint Designer.  Put your cursor inside this new web part, and click the Design tab in the ribbon.
  • In the Preview section of the Design tab, click the drop-down and choose No Matching Items Template.
  • Click the Split button at the bottom of SharePoint Designer.  Find the text in the code portion that says “There are no items to show in this view”. Put your cursor to the right of it.
    Extra tips: After you select the text in the bottom design pane, click the Design tab, click Customize XSLT and choose Customize item. Then, you’ll see that in the code you can see the exact text that you have selected.  In the code, you can put your cursor after the <xsl: value-of select=”$NoAnnouncementsHowTo”/>
  • This is the code that you need to paste in, so that users get redirected to wherever you want them to get redirected to.
    <meta http-equiv=”refresh” content=”0;url=http://yoursitetoredirectto”></meta>
  • Save the page.  (oh, and that number 0 in there is the number of seconds until you get redirected, which is none in this case because I want it to be instantaneous)

 

Basically, if there are no items in the list, we’re redirecting the user somewhere else.  In my case, if they haven’t taken the quiz yet, I’m redirecting them to the page that I created at step 2, with my instructional video and quiz.  After they’ve taken the quiz, then the next time they visit the productivity hub, they will have “unlocked” all the fancy web parts on the home page, with have the links to all the other help content.

Another method, is if you want people to be redirected if there IS something in that list of items, you’d put your cursor in the code inside the actual row of data where the item is, instead of in the no items template.

2 comments

  • Nice way to implement such a complex thing.Can’t we implement this thing with Survey List? As the format of question Can be easily managed in the survey list. Great post !!!

  • Yep Intelcs,
    Just like I stated, this can be done with ANY SharePoint list.

Leave a Reply