<img height="1" width="1" src="https://www.facebook.com/tr?id=730305433807073&amp;ev=PageView &amp;noscript=1">
Book a Demo

Advent Calendar Door 11: Creating KPIs in SharePoint Lists

Creating KPIs in SharePoint Lists

Now, here is an evergreen, a holy grail of all SharePoint requirements in today’s skybow Advent Calendar: KPIs. They can be found in each and any SharePoint project at some point of time: a nice, custom icon, representing the current state of the list item. It can vary from the simple green-yellow-red status field, to some very complex status indicators. Since SharePoint has never really delivered this functionality out of the box, in traditional development it almost always meant either fiddling with a lot of JavaScript (client side) or even writing event receivers to get it done server side (on-prem).

To achieve this with skybow Solution Studio, it is actually almost immorally simple.

  1. Upload the KPI icons you want to use to any SharePoint library in your site
  2. Select the list or library where you want to have a KPI-like field
  3. Create a picture field in that list (not hyperlink, really, a picture field)
  4. Go to “Things in background” => Field settings => Values, for that newly created field
  5. Select the “fx Expression” as Calculated Value type
  6. In the Expression field, use any expression to return the exact path to the KPI icon you want to show 

cahnge colums values.png

Those expressions can be very simple ones, such as:

[[amount]] > 10 ? "/sites/sitename/SiteAssets/green.png" : "/sites/sitename/SiteAssets/red.png"

The expression above (should be of “assignment type”) will just set a green or red icon in the picture field, depending on the value of the “amount” field in that list. As you see, we have created a fully functional KPI indicator, based on read field data (the “amount” field), within seconds!

The expression on the next screenshot is somewhat more complicated (and uses “Function code” expression type), but it gives you way more flexibility to create your KPIs., just the way you want it to be.

In this case, we want to show the status of a Purchase Order as a KPI icon. Based on other list data, out purchase order can be “Submitted”, “In process”, “Placed” or “Received”:

expression Builder calculated expression.png

And that’s basically it – development time is under 5 minutes, and your KPIs are in place, where you want them to be!

Adis Jugo

Written by Adis Jugo

is Director of Product Technology at skybow, and a software architect with over 20 years of experience. Adis is double Microsoft MVP (Most Valuable Professional) for Office Development and for Office Servers and Services. He first met SharePoint (and Microsoft CMS server) back in 2002, and since 2006 his focus was completely shifted towards architecture and development of productivity solutions, now based on the Azure, Office 365 and SharePoint technologies. Adis is an internationally recognized speaker with over 15 years of speaker experience, speaking at various Microsoft, Community and SharePoint/Office 365/Azure conferences worldwide.