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.

  • Comments:
    Teun,

    Thanks for this. I was trying to figure out why my survey was still not accessible after using this post: http://blogs.technet.com/lliu/archive/2006/10/14/wss-3-0-s-suboptimal-support-for-anonymous-access-scenarios.aspx. You pointed out the hidden flaw, which was the fact that I cannot use the page separator. Once I took that out, Presto! all is well. Thanks!
    Phillip Marcuson
     
    there is a good Survey Web part from Kwizcom - it also support aninymous access to surveys.
    you can see it here - http://www.kwizcom.com/ProductPage.asp?ProductID=333&ProductSubNodeID=353
     
    This works fine for a team site but not for a publishing portal...
     
    Maybe this works for you but when i click send after filling out a survey i get a username password box, which, when cancelled, creates a 401 UNAUTHORIZED error message
     
    I couldn't seem to get this to work on my publishing portal either. :-(
     
    Thanks! I didn't think this was possible. It might actually save me from having to mess with Adobe Acrobat forms.
     
    Hi Teun,

    Great posting. Another drawback to mention is you can't have branched questions as they create multiple pages as well.

    John
     
    also does not work on the mysite section
     
    Thanks for this post! Worked for me.
     
    Thank you for your posting. Works great!!!
     
    FYI...
    I used what I learned from this post and figured out how to do this programmatically.

    http://rustyc72.blogspot.com/2008/07/create-anonymous-access-survey.html
     
    This post has been removed by a blog administrator.
     
    Use the AnonymousPermMask64 property of the your list; you can add multiple permissions using |
     
    This post has been removed by a blog administrator.
     
    Works great fro me too. How on earht did you figure this out?
     
    thanks, this really helped me out
     
    I have a public facing MOSS Publishing site - and I didn't think this was possible. After a week of tearing my hair out - I found your post and problem solved!!

    The key to this is to NOT use page separators. This is huge for us because we wanted to be able to provide surveys that non authenticated users can view.

    I would like to add one more thing (and please correct me if I'm mistaken) but this does not work if you have the Server Lockdown feature activated.
     
    We have the box checked for survey respondents to only view their own response. It is not working and everyone can see all responses. Any suggestions?
     
    hi,

    after setting rights for anonymous user to add items and store this. the information of this get lost and this option is disabled, when i look another time after it
     
    Post a Comment

    Links to this post:

    Create a Link



    << Home

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