Add Additional Range Text to Rating Scale Survey Questions

I had a requirement to have a scale with 5 different text ranges within a survey question, by default you can only have three.

  • Strongly Agree
  • Agree (missing)
  • Neither Agree/Disagree
  • Disagree (missing)
  • Strongly Disagree

Question Settings



Click “Respond to this Survey” which will take you to the “NewForm.aspx” page.

Next click on “Settings” (cog) and click “Edit page”.

Add a “Script Editor” web part below your survey questions and insert the code below.

I’ve also included a few other changes which I think make a survey look a little tidier.


/* Removes Top Buttons */

/* Removes Line */
.ms-formline {display:none;}

/* Removes Number Headings */ {display:none;}

/* Change Main Question */
.ms-formlabel {font-weight: bold!important;}

/* Change Sub Question Options */
.ms-gridT1, .ms-gridCol {font-weight:normal!important;}

/* Change Sub Question Options Column Width */
.ms-gridCol {color:#444!important; width:110px!important;}

/* Change Sub Question Title Width */
.ms-gridT1 {padding: 0px 0px 10px 0px; width:300px!important;}


<script language="javascript" type="text/javascript" src="jquery-1.4.2.min.js"></script>
<script language="javascript" type="text/javascript" src="jquery.SPServices-2013.01.min.js"></script>
<script language="javascript" type="text/javascript">

$(document).ready(function (){

// 1st Rating Scale
$("").append("Agree ");
$("").append(" Disagree");

// 2nd Rating Scale
$("").append("Agree ");
$("").append(" Disagree");

// 3rd Rating Scale
$("").append("Agree ");
$("").append(" Disagree");

// 4th Rating Scale
$("").append("Agree ");
$("").append(" Disagree");

// 5th Rating Scale
$("").append("Agree ");
$("").append(" Disagree");



Get Items from Multiple Lists using jQuery & SPServices

Update: Only works for Site collection administrators

I had a requirement to collate the newest Announcements from all the sub-sites and display them onto the front page of an intranet site. I found this solution from Ben Tedder which worked but it wasn’t giving me quite the right result. So I continue my search and found this solution from Marc D Anderson, which was giving the right results but within an alert.

get-pages   get-announcements

So I decided to try and combine these two solutions into one. It starts by looping through all the sites within the collection and sees if an Announcements list exist and if there are any items within it. The CAMLQuery filters by where Expires greater than or equal to today or Expires is blank, sorts by Created descending and limited to one item. Next it builds the url to the display form (DispForm.aspx), within a dialog box and displays the results to a bulleted list.


<script type="text/javascript" src="jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="jquery.SPServices-2013.01.min.js"></script>
<script type="text/javascript" language="javascript">

$(document).ready(function() {

  var listName = "Announcements";

    operation: "GetAllSubWebCollection",
    async: false,
    completefunc: function (xData, Status) {
      $(xData.responseXML).find("Web").each(function() {
        var thisUrl = $(this).attr("Url");
          operation: "GetListCollection",
          webURL: thisUrl,
          async: false,
          completefunc: function (xData, Status) {
            $(xData.responseXML).find("List").each(function() {
              if($(this).attr("Title") == listName && $(this).attr("ItemCount") != "0") {
                  operation: "GetListItems",
                  webURL: thisUrl,
                  async: false,
                  listName: listName,
                  CAMLViewFields: "<ViewFields><FieldRef Name='ID' /><FieldRef Name='EncodedAbsUrl' /><FieldRef Name='Title' /></ViewFields>",
                  CAMLQuery: "<Query><OrderBy><FieldRef Name='Created' Ascending='False' /></OrderBy><Where><Or><Geq><FieldRef Name='Expires' /><Value Type='DateTime'><Today /></Value></Geq><IsNull><FieldRef Name='Expires' /></IsNull></Or></Where></Query>",
                  CAMLRowLimit: 1,
                  completefunc: function (xData, Status) {
                    $(xData.responseXML).SPFilterNode("z:row").each(function() {
                      var url = $(this).attr("ows_EncodedAbsUrl");
					  var url = url.substr(0, url.lastIndexOf("/"));
					  var fullUrl = '"' + url + "/DispForm.aspx?ID=" + $(this).attr("ows_ID") + '"';
					  var liHtml = "<li><a style='cursor: pointer;' onclick='javascript:SP.UI.ModalDialog.OpenPopUpPage(" + fullUrl + ", null, 800, 600); return false;'>" + $(this).attr("ows_Title") + "</a></li>";


<ul id="listItems"/>

User Profile Synchronisation Errors In SharePoint 2013

After doing a SharePoint update at the weekend, I found that I couldn’t get the User Profile Sync to restart. It looked like it was getting to a point then failing, so I started checking the Event Viewer, found some errors and then found this article from Richard Skinner.

During testing of SharePoint 2013 I experienced the Application Event Log errors below. When the errors occurred I was unable to run a User Profile Synchronisation with Active Directory.

Event ID 6398, category Timer

The Execute method of job definition Microsoft.Office.Server.UserProfiles.UserProfileImportJob (ID 0afab701-a201-4df9-bfc7-590838da8809) threw an exception. More information is included below. Generic Failure

Event ID 1004, category None

Detection of product ‘{90150000-104C-0000-1000-0000000FF1CE}’, feature ‘PeopleILM’, component ‘{1C12B6E6-898C-4D58-9774-AAAFBDFE273C}’ failed. The resource ‘C:\Program Files\Microsoft Office Servers\15.0\Service\Microsoft.ResourceManagement.Service.exe’ does not exist.

Event ID 1001, category None

Detection of product ‘{90150000-104C-0000-1000-0000000FF1CE}’, feature ‘PeopleILM’ failed during request for component ‘{1681AE41-ADA8-4B70-BC11-98A5A4EDD046}’

The resolution is to grant read access to the Network Service account to the “C:\Program Files\Microsoft Office Servers\15.0” folder


$Acl = (Get-Item "E:\Microsoft Office Servers\15.0").GetAccessControl('Access')
$Ar = New-Object"NT AUTHORITY\NETWORK SERVICE","Read, ReadAndExecute, ListDirectory", "ContainerInherit, ObjectInherit", "None", "Allow")
Set-Acl "E:\Microsoft Office Servers\15.0" $Acl

Display a list in another site collection

The Idea

Original Post:

<!-- Load and display list - jQuery version -->
<!-- Questions and comments: -->
<DIV id="ListPlaceholder"><IMG src="/_layouts/images/GEARS_AN.GIF"></DIV>
<script type="text/javascript">
// Paste the URL of the source list below:
var SelectedView = "";
$("#ListPlaceholder").load(SelectedView+" #WebPartWPQ1 .ms-listviewtable",function() {
$("#ListPlaceholder *").removeAttr("id");
$("#ListPlaceholder *").removeAttr("onclick");
$("#ListPlaceholder *").removeAttr("onfocus");
$("#ListPlaceholder *").removeAttr("onmouseover");


The main improvements in version 2:
– the script now works for both lists and calendars
– there won’t be any conflict if you place several scripts on the same page
– a form helps you select your options, and includes a debugging utility

Script Generator:

This script allows you to display in a SharePoint page a view taken from another site or site collection. In SharePoint, the standard way to achieve this is to use a Page Viewer Web Part. Compared to a PVWP, my solution:
– looks better, as the content from the other site is integrated in the page layout
– offers less functionality, as most of the interactivity is lost in the process. This is why I am using the term “snapshot”, rather than “view”.

Display Grouped Items:

<!-- Load and display list - iframe version for Grouped Items SP2010-->
<div id="ListPlaceholder" style="display: none"><img src="/_layouts/images/GEARS_AN.GIF" alt=""/></div>
<!-- Paste the URL of the source list below: -->
<script type="text/javascript">
function DisplayThisList()
var placeholder = document.getElementById("ListPlaceholder");
var displaylist = null;
var sourcelist = document.getElementById("SourceList");
try {
// Firefox, Opera
{displaylist = sourcelist.contentDocument.getElementById("WebPartWPQ2") ;}
else if(sourcelist.contentWindow)
// Internet Explorer
{displaylist = sourcelist.contentWindow.document.getElementById("WebPartWPQ2") ;}
else if(sourcelist.document)
// Others?
{displaylist = sourcelist.document.getElementById("WebPartWPQ2") ;}
catch(err) { alert ("Loading failed");} = "none";
sourcelist.contentDocument.getElementById("ctl00_IplsFooter").style.display = "none";
sourcelist.contentDocument.getElementById("MSO_ContentTable").style.marginLeft = "0px";
sourcelist.contentDocument.getElementById("s4-ribbonrow").style.display = "none";
sourcelist.contentDocument.getElementById("s4-titlerow").style.display = "none";
sourcelist.contentDocument.getElementById("s4-leftpanel").style.display = "none";

My Revision

Before we begin, you need to make sure that the view your using has the “Basic Table” style applied (Library/List Settings > Views).

Add a “Script Editor” web part to your page and add the following script.

<script type="text/javascript" src=""></script>
<script type="text/javascript">
function DisplayThisList()
$("#SourceList").contents().find(".ms-gb a").click(function() {

$("#SourceList").contents().find("#s4-titlerow").css({'height' : '0px','padding-top' : '0px','padding-bottom' : '0px'});

$("#SourceList").contents().find("").removeAttr("onclick onfocus href").css('text-decoration', 'none');

$("#SourceList").contents().find(".ms-subtleLink").attr('target', '_blank');
$("#SourceList").contents().find(".ms-vb2 a").removeAttr("onclick onfocus onmousedown").attr('target', '_blank');
}, 1000);

<ifram id="SourceList" src="http://intranet/Shared Documents/Forms/SelectedViewGroupBy.aspx" frameborder="0" onload="DisplayThisList()" width="100%" height="500"></ifram>

Note: Replace ifram with iframe (iframe are not allowed on for security reasons).


I hope you find my solution helpful.

Change Folder Content Type

Last week I had a request to add metadata to document library folders, thanks to this article (How to add a column to SharePoint folders) by Mike Smith I had the answer and before everyone starts I know you shouldn’t be using folders but it was the request.

Here the steps

  1. Go to Site Actions, Site Settings
  2. Click Site Content Types
  3. Click Create
  4. Give the new content type a name such as “Enhanced Folder”
  5. Set the parent content type group as Folder Content Types
  6. Set the parent content type to Folder
  7. Add the new content type to a Group. I put it back in the “Folder Content Types” group
  8. Click OK
  9. Scroll down to the columns section and click Add from new site column
  10. Name the column and set all the usual column options
  11. Repeat for any additional columns (Release Date, etc)
  12. Click OK
  13. Go to your document library
  14. Click Settings and Library Settings, or in 2010 click the Library ribbon tab and then click Library Settings
  15. Click Advanced and set Allow management of content types to Yes and click OK (this may already selected)
  16. Scroll down to Content Types and click Add from existing site content types and add your new folder content type
  17. Go to your library and click the New drop down, or the New button in the Document ribbon, and add your new folder!
  18. Go to the View drop down and click Modify this view and add your new folder meta data columns (you will probably want to move them to just after the Name column)

But, now I have my new content type, I had to update all the folders and sub folders with the new Enhanced Folder content type, PowerShell to the rescue.

$web = Get-SPWeb http://intranet/sites/test
$list = $web.Lists["Test"]
$oldCT = $list.ContentTypes["Folder"]
$newCT = $list.ContentTypes["Enhanced Folder"]
$newCTID = $newCT.ID

for($i=0; $i -le $web.Lists.Count; $i++)
   foreach($folder in $list.folders[$i])
      if ($folder.ContentType.Name -eq $oldCT.Name)
         $folder["ContentTypeId"] = $newCTID


Smooth Scrolling Promoted Links

I would like to start off by saying a big thank you to Thomas Kahn for doing all the hard work.

I come up with an idea to use the much-loved Promoted Links web part as a carousel. I thought that someone must have done this already, so I started with a Google search, but I couldn’t find a solution. I then started to look for away to carousel the divs within the Promoted Links web part and I found Thomas’s website



Upload all the required scripts and images, add a Promoted Links and Script Editor web parts to your page and insert the script below (update URL’s).

.ms-promlink-body {width: 90%; height: 150px; position: relative;}
.ms-promlink-header {display: none;}

<link rel="Stylesheet" type="text/css" href="http://intranet/Documents/css/smoothDivScroll.css" />

<script src="" type="text/javascript"></script>
<script src="http://intranet/Documents/js/jquery-ui-1.10.3.custom.min.js" type="text/javascript"></script>
<script src="http://intranet/Documents/js/jquery.mousewheel.min.js" type="text/javascript"></script>
<script src="http://intranet/Documents/js/jquery.kinetic.min.js" type="text/javascript"></script>
<script src="http://intranet/Documents/js/jquery.smoothdivscroll-1.3-min.js" type="text/javascript"></script>

<script type="text/javascript">

$(document).ready(function () {

mousewheelScrolling: "allDirections",
manualContinuousScrolling: true,
autoScrollingMode: "onStart"

$("#promotedlinksbody_WPQ2").bind("mouseover", function() {
}).bind("mouseout", function() {


Newsfeed for Everyone





Copy script, save as Newsfeed.dwp and add to web part zone.

<?xml version="1.0" encoding="utf-8"?>
<WebPart xmlns:xsd="" xmlns:xsi="" xmlns="">
<Description>Displays conversations and event notifications from content and people you follow across SharePoint sites, and lets users send short, publicly-viewable messages.</Description>
<Height />
<Width />
<DetailLink />
<HelpLink />
<PartImageSmall />
<MissingAssembly>Cannot import this Web Part.</MissingAssembly>
<PartImageLarge />
<IsIncludedFilter />
<Assembly>Microsoft.SharePoint.Portal, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>

Copy script into a Script Editor web part.

<script language="javascript" src="" type="text/javascript"></script>

<script type="text/javascript">

$(document).ready(function() {

setTimeout(function() {