Skip to content
Amal Hashim
All posts
Snippet

SharePoint Survey - Custom Action

Add a custom action to the Actions menu of a SharePoint survey list using a module in an empty SharePoint project.

Here is how to add a new custom action to the Actions menu of a survey list.

  1. Create an Empty SharePoint Project in Visual Studio.
  2. Add a module to the project.
  3. Edit the module's elements file so it contains the following:
xml
<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <!-- Survey Actions Menu Dropdown -->
  <CustomAction Id="6D6F6574-57CD-4BDD-88E5-9651A066140E"
    RegistrationType="List"
    Description="DescriptionGoesHere"
    RegistrationId="102"
    GroupId="ActionsMenuForSurvey"
    Location="Microsoft.SharePoint.StandardMenu"
    Sequence="4"
    Title="TitleGoesHere"
    ImageUrl="/_layouts/images/ctoa32.png">
    <UrlAction Url="/_layouts/THEPAGETOOPEN.aspx?ListId={ListId}&amp;SiteUrl={SiteUrl}"/>
  </CustomAction>
</Elements>
  1. Add a new feature and include this module in it, so the action is added when the feature is activated.

RegistrationId="102" is the list template ID for surveys. Replace THEPAGETOOPEN.aspx with your own page. {ListId} and {SiteUrl} are filled in by SharePoint when the user clicks the action.