Category Archives: SharePoint

JSLink – Filter on a Lookup Column with CSR

Lookup columns are both useful and a little odd in how they’re implemented in SharePoint list views. I wrote a bit about this in a previous post and showed one example on how to deal with Lookup column content. This post shows an alternative – and possibly more useful approach.

We’ll change the default link in the lookup field to a link that filters the current list by the lookup field value.  Yes, users can also use the filter built into the column header – this is just another way to implement it. I also think this is a bit more intuitive for users.

At the end of the day, this is just another example of custom link ‘building’ with CSR.
Sample File: CSR_LookupSelfFilter.js

Key lines:

With ‘Theme’ being the internal name of the Lookup field that we’re filtering on. Fairly straightforward.

The full list:

After clicking ‘Technics’:

Now we also need to add a ‘reset’ link to the web part so that users can get back to the default view. Otherwise, they could get stuck in a dead end after selecting a filter value. There are all kinds of ways to implement this, for simplicity’s sake we just updated the title text and link. 



Obviously you don’t *actually* have to change the text of the web part header – just the URL. Smile But again, it seems like better UX.

Hope this is useful.

JS Link and CSR Page

SharePoint Fest–Seattle 2016

The SPFest folks once again put on a wonderful show last week in Seattle. Big thanks to everyone involved!

Just a quick follow-up with session links to slide decks:

DEV103 – Client-Side Rendering for SharePoint: From Intro to Practical Application

  • SPFest Link
  • You can find lots of JS Link and CSR links on this page.
  • My Link
  • New post with updated script for Lookup link to filtered views (Updated: Link)

PWR202 – Designing and Building User-Friendly vs. SharePoint-User-Friendly Solutions
(previously listed as ‘DEV202’)

  • SPFest Link
  • Did you attend this session? Do you have an idea for a better title for the session?
  • My Link – Added a slide with screenshot on hiding lists with SharePoint Designer
  • Keep an eye out for new posts on PowerApps extensions to the scenario (I will add links)

I love hearing feedback so feel free to email or use the comment section. Thanks!

See you in Chicago!

Getting Started with PowerApps (Preview) for SharePoint Users

Notes and Setting Context

PowerApps is a new product/service offering from Microsoft for building business solutions that connect data from a variety of services and locations – including SharePoint Online. It is targeted at ‘power users’ – which is a somewhat broad and undefined group of users. It’s safe to say that not all SharePoint users will be able to build solutions in PowerApps intuitively as it does require a different skill set – but it is not coding.

  • PowerApps are available through an Office 365 account for users within your organization. Apps are not public-facing. You’re not creating a stand-alone app that anyone can download and run. It will only work for your tenant. The app owner determines who has access to the app: it could be a list of individuals or the whole organization.
  • PowerApps is not a replacement for InfoPath… yet. It certainly has potential. Yes, it has forms – but it’s not going to be on par with what InfoPath had to offer in terms of complexity for now.
  • PowerApps was not developed exclusively for SharePoint – so don’t expect a SharePoint-only kind of focus from the product. It integrates with a LOT more platforms and services. SharePoint is one of them and it already does do some cool stuff for the SharePoint platform.
  • PowerApps is targeted at the mobile platform – specifically phone and tablet devices, but it will be surfaced in the browser as well. The mobile client lists out apps that the user has access to. Apps can also be pinned to the desktop of your device rather than having to open the PowerApps app first.
  • Within SharePoint, PowerApps will soon have a presence within the new ‘modern’ SharePoint lists and libraries – more to come on that soon.
  • PowerApps is built on Azure. So it’s cloud-based. PowerApps Studio is a local tool, but connects to PowerApps Portal – which is a cloud service and relies on the cloud for Connections.
  • Connections’ and ‘Gateways’ are how you get access to services and data. Which ones are available will be determined by licensing… which is still TBD. While currently in Preview mode, we have access to all available connectors.
  • PowerApps is part of a broader effort targeting power users – so check out the other tools and capabilities as well.
    Start here:
    And here:
  • If you are or were an Excel or Access ‘guru’ building complex formulas, spreadsheets, and/or Access solutions, you’ll probably be pretty confortable digging into PowerApps (and Flow).
  • The documentation is fantastic for this point in a new product release. Seriously I can’t give enough kudos to the team putting this stuff together.

Where To Start

  1. Check out the tutorial found here: 
  2. Go to and log in with an account you use with Office 365.

Where To Go Next

Honestly, just dig in. It’s pretty easy. There definitely is a learning curve the deeper you get. But you’ll see a bunch of cool capabilities just by clicking around. You can have a mobile powerapp running on a SharePoint Online list going in minutes.

I’m putting my links and resources here:
So, without repeating all those links in this post, just check it out. Smile

PowerApps Preview – SharePoint Field Work-Arounds

*Disclaimer* – This post based on Preview version of PowerApps. I’ll make every effort to update with any changes and verify when PowerApps is released.

The following is a discrepancy happening in the Preview mode that will likely be resolved in the release version. Until then, something to mention so others don’t get frustrated when working with PowerApps during the Preview stage.

When looking at the columns in my SharePoint list, I have the following:

Figure 1

Now, I create a PowerApp based on the same list. BrowseScreen gives me four controls/fields on my card by default.

Figure 2

When using the dropdown values for the controls, I get the following:

Figure 3

Which is *not* the same as my list of fields. It looks like I’m missing:

  • ReqType (choice)
  • AssignedTo (Person)
  • CreatedBy (Person)
  • ModifiedBy (Person)
  • Status (choice)
  • Priority (choice)
  • Dept (Lookup)
  • Dept:ID (Lookup – additional field)

The missing fields are Choice, People, and Lookup fields. All of these fields are a bit more complicated behind the scenes. Thankfully we can still get to the data but we need to be a little more deliberate about it.

Note: ID comes as a bonus and IS available for selection. While ID is not shown in SharePoint’s List Settings we know we can get access to it in views. It’s a column that’s just behind the scenes sometimes in SharePoint.

As shown in Figure 2 above, PowerApps provides an easy way to select a control on the card and select which field it should represent. You can also use the Text property directly – either in the top property control or on the Advanced panel (select the View tab, then click on ‘Advanced’).

Figure 4

In the formula box for the property, delete the field name (‘Comments’). With the cursor after the period, the dropdown suggestion should now show all available fields – including our missing fields.


  • SharePoint’s CreatedBy is shown as ‘Author’.
  • SharePoint’s ModifiedBy is shown as ‘Editor’.


‘ThisItem’ is not needed in this example. You can type the field name directly. However, if you want to see a list of the fields available, you can use ‘ThisItem.’ in the formula.

Select ‘Editor’. Your formula now shows ‘ThisItem.Editor’, but the field is showing an error.

Figure 5 – ‘Attention needed’ in the Advanced panel

Figure 6 – ‘Attention needed’ in the form designer

As the message indicates, we need a text value to display, rather than what is essentially a person object. After ‘ThisItem.Editor’ add another period to see additional options – and select DisplayName. This provides what we’re likely looking for.

Figure 7

Figure 8

Choice fields work with:

Lookup fields work with:

If additional fields are selected for display (a field setting in SharePoint), they may show up as:
Ex. ThisItem.Dept:ID.Value

Currently seeing what should be Dept:ID showing up as:
Dept_x003a_ID – I’m guessing this will be updated before release as well.

People fields have a list of values available:

  • Department
  • DisplayName
  • Email
  • JobTitle
  • Picture

All in all, this issue doesn’t stop us from building what we’re trying to build, but it is an inconsistency in the UX and can be confusing or frustrating to folks during the learning curve.

Please – Let me know if you see something different so we can keep this info current.


MNSPUG July 2016 – PowerApps and Flow

Raymond and I did a presentation at the July 13th Minnesota SharePoint User Group a few weeks ago: Microsoft PowerApps and Flow: Overview and Integration Points with SharePoint. We had a nice crowd of 70-80 folks between the people in the room and folks that participated online.

Links to the presentation slides and recording (TBD) can be found on the MNSPUG site.

NOTE: In our slides we mention the connector for Office 365 Video. Right now there is an issue with that connector working with the current version of PowerApps. This is a known issue and Microsoft is working to resolve it.

Microsoft is generating a LOT of interest in these two new technologies – both still in Preview (now, and when the presentation was given). With the Ignite conference coming up this Fall, I’d be surprised if there isn’t more to see by conference time – between polishing the release version, adding new features, and potentially releasing one or both of the products. Stay tuned.

*Disclaimer* – This post based on Preview version of PowerApps. I’ll make every effort to update with any changes and verify when PowerApps is released.

May the 4th – The Future of SharePoint summary

Big day in the SharePoint world today as Microsoft announces lots of updates coming to Office 365, SharePoint Online, and coming in SharePoint 2016.

First up – ‘SharePoint’ is back. It seems like small thing, but when you’re in Office365 and click on the ‘waffle’ menu in the upper right – instead of ‘SharePoint’, we’ve had ‘Sites’. Not a huge deal to some, but it diminished the brand a bit. With the latest updates we’re returning to ‘SharePoint’.

Next, lots of updates: big and small. Topics include:

  • SharePoint mobile app – sorry, I just can’t say ‘your intranet in your pocket…’
  • SharePoint home (web/O365)
  • Team Sites + Office 365 Groups – better together…
  • Modern library and lists experiences (more on what this means for CSR…)
  • PowerApps integration
  • Microsoft Flow integration
  • Modern pages experience
  • Improved site activity tracking
  • SharePoint Server 2016
  • OneDrive for Business and O365 file sharing updates
  • The SharePoint Framework – open and connected
  • Security updates
  • Feature packs for on-prem

You can find links to the key announcements and sites here:

Microsoft blog posts:

Event recap, recordings, and deep dives:

Other references and links:

There will be more updates in the coming days. I’ll try to update here with relevant links, etc. as they develop.

The Future of SharePoint – Without(?) CSR and JS Link

Microsoft recently announced a new document library experience. Today as part of the May the 4th ‘Future of SharePoint’ event a similar new experience for lists was announced. Ultimately, good moves in the broader effort to improve user experience within SharePoint and an evolution forward. But what, if anything, does this mean for JS Link and Client-Side Rendering (CSR)?

Let’s take a look… I’m not going to give a deep tour of the new interface – that’s for another day. Just focusing on the CSR implications right now.

So, the new list and library interface is locked down. The default page still uses the default chosen view and you can quickly and easily switch views. The page, however, has no editing options. We can’t get to the edit page and edit web part interface. So no-go for CSR. Still, not terrible – while you *could* edit the default page, it wasn’t generally a good practice. (of course, there were some relevant use cases out there…)

Now, if you’re creating pages and adding web parts of these lists and libraries to the page – we’re still in the game. This hasn’t changed… yet. We can still build out pages, add CSR via JS Link and build out our solutions.

So, the short story is that CSR and JS Link still works in 2013, 2016, and O365. There are a few fuzzy spots on the radar for O365 and 2016 though. The new page experience and the new SharePoint Framework are likely to creep into the CSR space. What the roadmap details and timeline are remain to be determined.

Note: If you still need to edit the main library and list pages, you can switch back to ‘classic’ mode. This can be done at the library, site, or site collection levels. Links available below.

References and related materials:

JSLink – Using the Lookup Column with CSR

This post covers another column type for use with CSR overrides. Lookup columns have what I consider an irritating default display characteristic in that they are displayed as a hyperlink to the lookup list item.


Where the link goes to:


The majority of the times I’ve seen a Lookup used, they are simply a list of items to select in a dropdown or radio buttons – like a category. In this case the hyperlink and displaying the form are useless (to me). Every so often the lookup list has a few other fields, like Description, etc. in that case the link can be a bit more useful, but it still seems to be more of a distraction from a user experience (UX) perspective.

What I’d like to see is the Lookup value – the same text – displayed without the hyperlink. I can get this value using the following:


Or, more generically:


You can also access two other properties of the item. The properties are: isSecretFieldValue, lookupId, and lookupValue. And no, right now I have no idea what the heck ‘isSecretFieldValue’ is other than a Boolean value. Smile 

Note: OK. I looked it up. There’s one post under ‘isSecretFieldValue’ here – and if set to ‘True’ it apparently hides the values of the Created By and Modified By values in the form. Huh.

Back to our Lookup column.

As with several other column types, the Lookup column can contain more than one item and is stored as an array. As with those other column types you can also check how many items are contained in the column value by checking the length of the array:


Once an override is put into place using this approach, the list view now looks something like this:


Definitely cleaner.

Sample code for this example can be found here.

JSLink – Using the Person Column with CSR

When starting with JSLink and CSR (Client-Side Rendering) in SharePoint 2013 one usually starts with text fields. They tend to be the most intuitive and simple. Referring to a text field looks like this:

ctx.currentItem.[internalName] like “ctx.CurrentItem.Title”

Pretty straightforward. Other fields take a little bit more poking around to figure out the correct syntax. Person fields, like a few other field types, allow for one or more values to be stored – meaning the data will be stored in an array. Because of the array, overriding Person fields looks something like this:

The name:

The email address:

For some reason, the complete list of properties that are available for my ‘Created By’ field (internal name ‘Author’ – using Name with Presence) and ‘Modified By’ field (internal name ‘Editor’) are: email, id, picture, sip, and title.

However, when I have a Person field that I manually add to the list the properties I get are: department, email, id, jobTitle, picture, sip, title. When a People field allows multiple values it also has a ‘value’ property.

I’m not sure why you get the extra properties (department,  jobTitle, and value)  in addition to the original fields. The manually added field also has the picture property populated by the data from the user profile while the Created By and Modified By fields do not. More to dig into at another time.

If the Person column does contain more than one item, you can check ctx.CurrentItem.[internalName].length and then iterate through the array for all the names, email addresses, etc.

Definitely more nitty gritty details on how these fields work. But this should get you started for now.

Display Links to SharePoint Item Attachments using CSR

I had an inquiry this week regarding whether or not CSR could be used within a SharePoint list view to display links directly to an item’s attachments. It took a bit of tweaking code around a bit, but Raymond Mitchell (@iwkid) and I were able to get it working.

Background: SharePoint lists may allow for attachments to list items. SharePoint also has a default column that can be used in a view for displaying whether or not an item *has* one or more attachments. (Is that Clippy in disguise?)


A user experience (UX) stumbling block however is that you have to open up an item view in order to see the list of items and links to them. If you’re familiar with SharePoint, not a huge UX issue, but still somewhat irritating compared to just seeing the list of items in the view directly. If you’re *not* SharePoint-savvy, then you might not know at all whether an attachment exists or how to see attachments.

We’re aiming for something like this:


The CSR JavaScript file can be found here: CSR_ViewAttach.js

Note: I’m sure the JavaScript gurus out there will find more code cleanup that can be done and methods that can be used to improve it – this should get you started. We’ll add new versions as improvements are made.

Instructions for use:

  1. If you don’t already have one, create a ‘scripts’ document library on the Office365 / SharePoint site you’ll be using the CSR file on.
  2. Download the JavaScript file from here
  3. Edit the JavaScript file to work with your column, list and site URLs (see more in the sample file or below)
  4. Upload the edited JavaScript file to your ‘scripts’ library.
  5. jQuery is required for this CSR to work. If you don’t have jQuery already, upload it to the same scripts library. (See this post for more information on using jQuery with CSR)
  6. Add the Script Editor web part to your page or use the ‘Embed Code’ option to add a reference to jQuery.
    Ex. “<script language=”javascript” type=”text/javascript” src=”../Scripts/jquery-2.1.3.min.js”></script>”
  7. Your list: If you don’t have a ‘spare’ text column you can use to override in a view, create a new text column (ex. ‘ViewAttach’).
  8. Create a view for your list that includes your new column. You can still use all the same sorting, filtering, and other other view configuration settings for this view.
  9. When using your list view, edit the web part and add the link to your JavaScript file to the JS Link property of the web part. It will look something like: ~site/Scripts/CSR_ViewAttach.js

If everything is in place, attachments in your list should now be listed in the column you identified. (If not, check the common troubleshooting items for CSR… hmm, that sounds like another post…)

Items to configure in the JavaScript/CSR file before it will work in your environment (these are also noted in the file itself):

  • The (internal) name of field being overridden. In the example code below we’re using the ‘Body’ column (which is the internal name for the ‘Description’ field) of a task list. You can override any text field and/or create your own.
  • The siteURL variable.  — See example in the CSR file itself
  • The listName variable.  — The list that includes the attachments you’re displaying links to (example in file)
  • The attachPath variable.  — Link to where attachments are stored (example in file)

Thanks, Notes, and References:

Please let me know how this works for you!