Remove claims token with regular expressions and Nintex on Office 365

Remove claims token with regular expressions and Nintex on Office 365

When you get the value of a person via Nintex Workflows, you often get a bit of a messy string back – it starts with “i:0#.f|” and may also be “i:0#.f|membership|” . That string is the claims token. Here’s how to get rid of it using the Regular Expression action on Office 365.

Continue reading

Add a webpart to a view on any SharePoint list or library

Add a webpart to a view on any SharePoint list or library

One of my favorite features in SharePoint is the sheer power available in lists and libraries. I love teaching this part of the platform because there are so many hidden gems, functionalities that people really don’t know about but can make such a difference.

This post is about adding a webpart to a list or library  view page. This functionality has been available since SharePoint 2010. Did you know that every single view in SharePoint is its own page and has its own URL, so that you can link directly to it?  This means that every single view page can be edited so that you can add a webpart to it.

Continue reading

What is governance in SharePoint 2013?

Microsoft has a ton of information regarding SharePoint governance. Considering that it’s such a broad subject, lots of documentation is good. The challenge is finding the most important bits.

The article that provides the best overview is Microsoft’s Technet article What is governance on SharePoint 2013?  A related TechNet article is Governance planning on SharePoint 2013.It includes a download of one of my favorite Microsoft SharePoint governance resources: the huge overview image that shows how to tie it all together (see it on ZoomIt). Microsoft made one of these for SharePoint 2010 and possibly for SharePoint 2007. It has evolved as the product has matured but is a fantastic resource.




Adding a code snippet to page content on SharePoint 2013

Note: this post is written specifically for SharePoint 2013.

Sometimes it is necessary to add a snippet of code to just one page. Examples could be:

  1. Alternative CSS for just that page, i.e. to style a specific element
  2. Add a snippet of HTML and/or JavaScript, such as for a Google Maps or Youtube embed
  3. Add a piece of CSS to hide the left navigation on specific pages
  4. Add the Open In Explorer Link to a page

There are technically a number of ways to achieve this:

  1. Paste the code directly into the page contents (does not work)
  2. Paste the code into the the HTML source of the Content Editor Web Part (can work, depending on SP version and code)
  3. Use the Embed command  (can work, situational)
  4. Save the code in a text file, save it somewhere on your SharePoint site collection and call the text file via the Content Editor Webpart (my preferred method)

Option #4 is my favorite for a number of good reasons:

  • You can save the code centrally and then call it from multiple places without needing to replicate it
  • By saving it centrally, you only need to update it once if there are changes or updates
  • By saving it in the content database, you can access it from SharePoint Designer or similar, meaning you do not need to keep downloading-updating-uploading
  • It works consistently across all versions of SharePoint from SharePoint 2007 up to Office 365

For this example, I will be using a simple JavaScript which shows copyright information, in this case from 2010 to the current year. This allows the copyright to be kept up to date:

<p>All right reserved  &copy;
var cur = 2010;
var year = new Date(); 
if(cur == year.getFullYear()) year = year.getFullYear(); 
else year = cur + ' - ' + year.getFullYear(); 

Option 1: Paste the code directly into the page content

You can paste the code directly into the page content.


However, once you save the page and view it, you will see that SharePoint does not realize that it is code it needs to render in some way.

Conclusion: do not place code directly in the page content as it does not work.

Option 2: Edit source in rich text area / CEWP

In most content editor webparts and all rich text areas, there is a button in the ribbon called “Edit source”. This is great for quick fixes when content has gotten out of hand. In older versions of SharePoint, you could also use it to embed extra code.

Edit Source

You can easily paste your code straight into the Edit HTML window.

However, once you save, SharePoint lets you know that the code that it does not approve of has been stripped.


In this case, some of the embedded code has been stripped out.


Sometimes SharePoint will strip out all of it and sometimes it will only strip out parts which can cause an odd result. When it doubt, check back into the HTML source to see what has happened with your code and if it is still 100% intact.

Conclusion: while this used to work under some older SharePoint versions, it is generally not a reliable solution for SharePoint 2013.

Option #3: Using the Embed command

SharePoint 2013 includes an Embed command in the ribbon which can be great for adding code snippets to your page:


After clicking the command, you are prompted to insert your code and given a preview:


SharePoint creates a Script Editor webpart on the page for you. It even includes an “Edit Snippet” button, so you can go back and edit the code later.


The JavaScript is being displayed correctly in the webpart and also on publishing the page.

Conclusion: in my experience, this works but is dependent on the complexity of the code. Test well before using.

Option 4: save as a text file, call via CEWP

I have saved the JavaScript into a file called copyright.html. The file extension can help SharePoint determine how to parse the code when it is called, but you may need to experiment depending on your code – I have had good results from using txt, html and js extensions in the past.

Here is the file in Notepad++:


In this demo, I uploaded the HTML file to the document library on the same site as the page we are working with.


Tip: I tend to use the following rules of thumb as to where to upload these kinds of files:

  1. Think about if you want to save it in the standard Document library, or if you want to create a dedicated document library called “Scripts” or similar
  2. If the file will be called from just one single site, save it on the site
  3. if the file will be used across just one site collection, consider saving it at the root of the site collection or in the Style Library of that site collection (i.e. Styles/Scripts)
  4. If using across multiple site collections, choose the most logical place for it, i.e. on a root site collection

Next, place a Content Editor Web Part (CEWP) on the page and edit the webpart settings. At the top, add the link to the file and click “Apply” to save the changes.


The content should immediately display in the CEWP on the page.


Tip: if  you wish to use the same webpart in many places, you could export the configured CEWP and import it as a custom webpart. You can then place it on a page and it will already be configured for you.

Conclusion: this is my favorite method due to the central storage of the files, ease of editing the files and reusability.

Calculated column for priority

I’m currently working on a project where we needed to assign a priority to issues based on impact and urgency. You could always let users figure this out for themselves, but it’s much better to automate it when there are clear definitions for each value and a table which translates the impact and urgency to priority.


My first thought was: “Sure! I’ll do that! It’ll be simple.” Then I found myself looking at the calculated column formula screen and realized that it had been a long time since I had needed this knowledge.

The first limitation is that SharePoint only allows for up to 7 nested IFs. I broke the solution up into four calculated columns:

  1. Priority – Very Urgent
  2. Priority – Urgent
  3. Priority – Not urgent
  4. Priority – calculated

The first three columns calculate the correct priority value based on each urgency line. If the urgency is very urgent, the formula checks to see what the impact is and then sets the field value to the priority listed in the table.  If the urgency in that issue does not match the formula (i.e. if the urgency is not very urgent), the field value is set to “N/A”, as that urgency is not applicable.

/* Very urgent */
=IF(AND(Urgency="Very Urgent",Impact="Critical"),"1",
IF(AND(Urgency="Very Urgent",Impact="High"),"1",
IF(AND(Urgency="Very Urgent",Impact="Medium"),"3",
IF(AND(Urgency="Very Urgent",Impact="Low"),"3",
IF(AND(Urgency="Very Urgent",Impact="Very Low"),"4","N/A" )))))

/* Urgent */
IF(AND(Urgency="Urgent",Impact="Very Low"),"4","N/A" )))))

/* Not urgent */
=IF(AND(Urgency="Not Urgent",Impact="Critical"),"2",
IF(AND(Urgency="Not Urgent",Impact="High"),"3",
IF(AND(Urgency="Not Urgent",Impact="Medium"),"3",
IF(AND(Urgency="Not Urgent",Impact="Low"),"4",
IF(AND(Urgency="Not Urgent",Impact="Very Low"),"4","N/A" )))))

To tie it all together, the Priority – calculated column looks at the values of all three columns and displays whichever one does not have the value “N/A”. If none of them have that, then the column displays the text “error”.

/* Final calculation */
=IF([Priority - very urgent]<>"N/A", [Priority - very urgent],
IF([Priority - urgent]<>"N/A", [Priority - urgent],
IF([Priority - not urgent]<>"N/A", [Priority - not urgent],
"Error calculating priority")))

To test, I showed all 6 applicable columns in a view:


You can see that because the urgency was very urgent and the impact was critical, a 1 was filled into the priority – very urgent column. When the Priority – calculated column did its work, it copied over the 1 from the priority – very urgent column.

Calculated column for priority on a SharePoint list

I’m currently working on a project where we needed to assign a priority to issues based on impact and urgency. You could always let users figure this out for themselves, but it’s much better to automate it when there are clear definitions for each value and a table which translates the impact and urgency to priority.

Continue reading

SharePoint Connections 2013 Recap #SPCon13

Phew! Barely home long enough to catch my breath and write a quick post about SharePoint Connections 2013! It was great to meet up with old colleagues and friends alike, as well as make new connections.

So much happened and I talked to so many people, I’m just going to sum up the highlights – in no particular order!

I’m really sorry I didn’t get to see my colleagues’ session on Once You App, You Don’t Go Back, which was done by Daniel Sörlöv and Alexander von Malachowski. They were kind enough to show me the speakers room (it really wasn’t as impressive as it sounds) … so I brought all the speakers some fresh stroopwafels.

2013-11-20 16.22.52

Benjamin Niaulin

Benjamin Niaulin‘s session on the Search Content Webpart was just hands down awesome. He’s such a fun, passionate guy that you want to pay attention to him and laugh along with him. Plus, he did a little dance to illustrate how continuous crawl in SharePoint 2013 works. For this reason, I will never forget how continuous crawl actually works.

One of my notes from his session is a direct quote:


I already thought Benjamin Niaulin was pretty cool, because his blog post on Step by Step: Create a SharePoint 2013 Composed Look is my most referred-to resource for SharePoint 2013 design. Seriously, though: he’s even cooler in person.

Martin Hatch

I’d never seen or met Martin Hatch before, but his session on Dude, Where’s my Search Scopes – Walkthrough of the new Search Capabilities in SharePoint 2013 was excellent.  He did a wonderful job of showing us the different functionality and I do hope to see him again at more sessions.

Joel Oleson

I saw both of Joel Oleson’s sessions.

SharePoint 2013 Mobile Strategy and Responsive Web Design

The part about responsive vs. adaptive design was fantastic and I’ll definitely be looking into using this more.

Also, he got into the support for mobiles for SharePoint 2010 and SharePoint 2013:


Upon seeing this, I promptly tried to find all of these for Android:

  • Newsfeed: is coming, but unsure when
  • Office Mobile App: awesome, works wonderfully!
  • SkyDrive Pro: couldn’t find it in the app store, but Office Mobile App was great anyway
  • Office Web Apps: meh, but it worked

SharePoint 2013, Office 365, Yammer and Social Compliance

I loved that he showed multiple videos and pictures within his presentations.

Compliance is like herding cats: 

And… lead the community with subtle movements, don’t try and control everything:

Joel also did a write-up of the event on his blog – he has more interesting pictures than I do: SharePoint Connections Amsterdam Event Recap and Slides #SPCon13

Dan Holme’s governance workshop

I participated in Dan Holme‘s governance workshop on the third day and I’m so glad I did.  Dan is a wonderful speaker and he did a great job of making this session work from both an IT-Pro as well as a business perspective.

I loved how he used the analogy of SharePoint as a sand castle and how he reused this analogy many times throughout the day.

I teach information architecture and occasionally information management. This diagram, which was the core of the morning section, was worth the entire price of the day for me:


There were plenty of other useful things throughout the day, but this was definitely the highlight for me.

Galaxy Note 3

I spent a fair amount of the conference playing with my new phone, the Android-based Galaxy Note 3. Yes, I realize it’s more of a tablet than a phone, but that’s ok – I do most of my calling via my Bluetooth Jawbone anyway.

I don’t really use most of the Samsung apps. I find that there is too much bloatware and they just don’t do what I want. However, while playing around, I found an awesome combination: Papyrus + Evernote.

I was able to use Papyrus to write notes on the screen, even to take a picture of a slide and then draw all over it. I could then export the entire note to Evernote, which can generally interpret my handwriting and make it searchable! At least, when I wrote somewhat neatly.


The thing is, I want an even bigger screen now. Something like the Galaxy Note 10.1 would do it, I think. That 2560×1600 pixel resolution looks pretty awesome.


There you have it, my summary of SharePoint Connections. I learned a lot, but the most valuable part was the networking and getting to reconnect with old colleagues and friends.

Hopefully next year I’ll be wearing a speakers shirt!