Thursday, July 26, 2007

 

Using Surveys on anonymous access SharePoint sites

One of the nicer features of SharePoint are Surveys. They allow you to create a set of questions (both multiple choice and open) and have users of the site fill them in. It allows for selections from a set list, rating scales (where you rate a number of items along ascale from, say, 'not at all' to 'extremely') and even flow logic (where the outcome of one question causes certain questions to be skipped).

For intranet-type team sites, this just works like a charm. For public sites with anonymous access however, it turns out not so easy. To fill out a form, the user must have write access to the survey's library for example. Normally, we of course never allow write access to anonymous users. This article will show you how to configure your survey for use on a public anonymous web site (it involves a little trick). Note that this tutorial applies to ALL flavours of SharePoint, both WSS 3.0 as any of the MOSS 2007 licenses.

Create the survey

In this tutorial, we assume that you already have a SharePoint site set up and that it is accessible to anonymous users (check this article for a tutorial). First we create a new survey by selecting 'Survey' from the Site Settings page. You will see this screen:

We enter a title and description for the survey and select a few navigation options. When we click Next, we see this screen, allowing us to create te first question of the survey:

You can add any number of questions to the survey, distributing them on multiple pages through inserting page breaks. Eventually, you click Finish to create the survey. You will be redirected to the Survey Settings page: From this page, two links are important to us: 'Advanced Settings' and 'Permissions for this survey'. We first go to 'Advanced Settings'.

Set advanced settings

On this screen, we set 'Read Access' to 'All Responses', 'Edit Access' to 'Only their own' and 'Allow items from this survey to appear in search results' to 'No'. Setting read access to 'All Responses' seems a bit weird. After all, you will normally not want your anonymous users to see the responses of all other users. We will change this back later, but for some reason, it is necessary to select this option here.

Set permissions

Next we go to the permissions screen: The survey by default inherits the permissions from the site, but for anonymous surveys this will not do. By selecting 'Edit Permissions' from the 'Actions' menu, you can specify specific permissions for this survey. The Setting menu has now appeared and from it, we choose 'Anonymous Access'. In this screen, make sure that the checkboxes for 'Add' and 'View' are selected.

Set advanced settings again

If this is alright, we can go back to the 'Advanced settings' screen to set Read Access back to 'Only their own'.

There, you're set. The survey can be filled out by all anonymous users, but they cannot see each others entries. The information entered in these forms will be stored in the survey's library and you can inspect each entry or view aggregated graphs of all entries. So what happened here? We first set the 'Read Access' to 'All Responses', because only then can we set the Anonymous Access settings (all checkboxes will be greyed out otherwise). But after setting the permissions, we can safely turn access to all responses off again. This procedure is a bit odd, but it works.

Drawbacks

Some parts of the default SharePoint survey functionality may not be exactly as you would like it:
  • Even if you set 'Allow multiple responses' to 'No', anonymous users will be allowed to enter the same survey many times. Most Internet polling applications would try to prevent this using cookies or IP address tracking, but none of this is even tried by SharePoint. For most surveys this is not a problem, but don't use this functionality for 'Voting'.
  • You cannot use surveys of multiple pages. For these, you need to store and edit the surveys information and there is no way to set up the surveys to allow anonymous users to update their own record and not allow them to see and edit all other users' information. So don't use that Page Break type!
  • Users can see the Survey summary page, which displays the number of entries. This may not always be as desired. You can send users directly to the form, but the survey summary will still be accessible if you know the URL.
  • You will probably want to be alerted whenever someone enters a survey, but SharePoint does not support allerts on list that allow users to see only their own entries. Not even for administrators. You might be able to keep track of new entries by consuming the RSS feed from the survey.

  • This page is powered by Blogger. Isn't yours?