Some thoughts on programming stuff

You are not allowed to respond again to this survey in SharePoint

One of my favorite list templates in SharePoint is the Survey template. It’s a fun and useful feature that helps you on achieving good survey-like forms with charts and insights. You can make them anonymous, do some customizations and add Branching Logic, which means conditional questions depending on what the user answers. But unfortunatelly there are some drawbacks like the message you receive of You are not allowed to respond again to this survey in SharePoint.

You are not allowed to respond again to this survey in SharePoint - Form example
Form example
You are not allowed to respond again to this survey in SharePoint - Survey overview
Survey overview

But it has one main behaviour that I just don’t like, that is the message when you try to answer the survey again. Below you can check the message with Custom Errors disabled.

You are not allowed to respond again to this survey in SharePoint - Error message
Error message

Theorically, the user has the required permission to edit its answers. But unfortunatelly once I try to answer again, SharePoint shows me that message as an error. This is a huge problem for users that don’t understand this message and it can be negative to the system.

That’s why I decided to write a script for those who need to edit the response whenever it happens. On internet I could find some nice examples and one of them helped me a lot, that’s why I added this one to my references list on the bottom of my post.

Here is the code which you can add to your Overview page on your Survey.

You can check the source code on Github too.

Anyway, I hope this post can help you on not viewing the message: You are not allowed to respond again to this survey in SharePoint. There are other posts too about SharePoint customizations that can help you here.

EXTRA:
Another interesting functionality that SharePoint Surveys lack is the Back Button. Fortunately, someone already shared a jQuery approach for SharePoint 2010 and also for SharePoint 2013 for having it on your lists too.

References:
Support Office – Create a survey
Friendly message when user tries to take survey again

8 Comments

  1. Shaiane

    Very nice!

  2. Victor

    Thanks for the post, it was very useful.
    Only one small correction in function readSurveyVotes, the correct xml caml to filter author is:
    var viewXml = “” + _spPageContextInfo.userId + “”;

    • Wiliam Rocha

      Thank you for correcting me, Victor. I’ve made the change on the Script.
      I believe your approach will help people on not experiencing problems with queries made by System Account!

  3. Shivaji

    For me the CAML query was returning the All records.Corrected xml CAML Like this.
    =======================================================
    var viewXml = “” + _spPageContextInfo.userId + “”;
    =======================================================

    • Wiliam Rocha

      Hey Shivaji,
      I couldn’t find the mistake. Hope it’s working for you this way:
      var viewXml = ‘‘ + _spPageContextInfo.userId + ‘‘;

  4. Rhonda

    Go to “Settings –> Survey Settings –> Title, description and navigation or List name, description and navigation –> Survey Options –> Allow multiple responses? –> Yes”

    • Wiliam Rocha

      Hi Rhonda!
      Thanks for the comment and for the suggestion! Your approach may stop the error message from happening, but what if I want just one answer per user?
      Anyway, your solution is great too!

  5. Central It

    Your way of describing all in this article is really nice,
    all be able to easily be aware of it, Thanks a lot.

Leave a Reply

Your email address will not be published. Required fields are marked *

© 2024 wiliammbr's blog

Theme by Anders NorenUp ↑