SharePoint: XML is dead – long live JSON |

Our Blog

17

Jul

SharePoint: XML is dead – long live JSON

While I loved the power of XSLT, I was never really a big fan of XML. Yes, I used it when I had to but it always seemed like a lot of effort to get anywhere – and don’t get me started on the “fun” I have had parsing poorly formatted XML.

JSON on the other hand – I almost look for an excuse to use it and in SharePoint, JSON is becoming prevalent while the use of XML almost seems to be limited to legacy needs.

So what can we do with JSON in SharePoint?

JSON Editor

Firstly, this almost went unnoticed, but JSON is now a recognised document format in Microsoft Office 365 and even has its own online editor. You can save a JSON document to a SharePoint library and select preview to view it and open to edit its contents. It also incorporates a nice to manage version control.

Microsoft Office 365 JSON Editor

Column Formatting

While I am still in mourning over the premature demise of JSLink – yes I know it is still there but I am sure the writing must be on the wall – I am encouraged that we can now customise how columns appear using JSON.

SharePoint JSON column editor

There are some good posts on this to get you started, including "Use column formatting to customize SharePoint".

For those who have been following along for a while, this is a nice logical next step from XSL Link and JSLink, allowing non-developers to apply some simple formatting to SharePoint list columns. However, it does feel a bit unfinished and I am hopeful it will mature a bit over time, with more capabilities but at the moment it definitely feels a bit constrained.

Site Themes

If you have not tried it yet take a quick look at the Theme Generator, a great tool to create custom colour themes for SharePoint – and guess what format the output is to apply to your site? JSON of course!

SharePoint JSON site theme

Again, Microsoft have provided some good posts on using this ("SharePoint site theming"). However, note that this only applies to the new style of SharePoint sites. You cannot just apply these to the more traditional team sites etc.

Site Configuration

Also just for the new style of SharePoint sites, JSON can even be used to customise sites. You can create content types, add lists, apply a theme, even trigger a Flow – and all using JSON – more information available at site design JSON schema:

{
"verb": "createSPList",
"listName": "Customer Tracking",
"templateType": 100,
"subactions": [{
"verb": "setDescription",
"description": "List of Customers and Orders"
}]
}


This is a great way of setting up templates and ensuring new sites can be provisioned in a consistent way. However, I have to say that while the JSON is relatively straightforward, applying it is a bit more of a challenge.

Come see me at the Digital Workplace Conference

I will be presenting all this and more at the Digital Workplace Conference in Melbourne on 15-16 August 2018. Come along and say hello.

Posted by: Dave Paylor, Team Leader, Portals & Productivity Solutions Office365 | 17 July 2018

Tags: SharePoint, Digital Workplace


Top Rated Posts

Blog archive

Stay up to date with all insights from the Empired blog