SharePoint New Item Form Actions

The following post describes 3 of the many new Form Actions available in SharePoint.

This example shows how to return to home page after user cancels creating the item.

This example shows how to show an alert and wait for OK or Cancel action.

This example shows how to return to home page after user creates the item.

Do make a note that above code requires the Jquery is referenced in the page.

Sharepoint list quick edit not available?

When you are vieweing a custom view and don’t see the “Edit” menu also called as “Quick Edit”, make sure that particular view has the “Tabular View” configured. This is one of the reasons why sharepoint list’s quick edit is not available in custom viewes.

Steps to configure “Tabular View” to enable quick edit.

  1. Goto -> List Settings -> Views -> Click on the view where the “Edit” doesn’t show up
  2. In the view edit page, expand “Tabular View” if not already expanded
  3. Check the “Allow individual item checkboxes ” checkbox.
  4. Click “OK” to save the view settings

Now the quick edit should have been enabled.

Note: This is applicable for modern view available in Office 365, SharePoint 2016 & SharePoint 2013.

Display attachments using JSLink in SharePoint

Recently I had a requirement where the customer wanted to show the actual attachment’s URL in the list view instead of default Icon. Following JSLink code will help to do that.


Change SharePoint’s “there are no items to show in this view” message

When a list has not data to be shown in the view, we see the following message.

There are no items to show in this view of the “<ListName>” list.

The following JSLink script helps to change this message.


Displaying SharePoint user presence indicator in CSR

The following are code snippets which can be used to show a user’s Lync/Skype for Business presence status in SharePoint Client Side Rendering (CSR).

Default Render

With Picture Detail View

With Picture

Presence Only

Picture Only


Remove duplicate list items from SharePoint REST call result using JavaScript

The following code snippet show how to remove duplicate list items in the JSON result of a SharePoint REST call using JavaScript.

Function Definition:

Function Usage:
In the below code, assumption is that, the REST call returns data.d.results and the column for which duplicate items need to be removed is Title


JSLink URL Tokens in SharePoint

Following are some of the JSLink URL Tokens I have come across in SharePoint.

  • ~site – reference to the current SharePoint site (or “Web”)
  • ~sitecollection – reference to the current SharePoint site collection (or “Site”)
  • ~layouts – version specific reference to the web application Layouts folder (so it will automatically swap out /_layouts/14 or /_layouts/15 for you)
  • ~sitecollectionlayouts – reference to the layouts folder in the current site collection (e.g. /sites/team/_layouts/15)
  • ~sitelayouts – reference to the layouts folder in the current site (e.g. /sites/teams/subsite/_layouts/15)

Few Examples:


Refresh web part without refreshing page in SharePoint

The following code shows how to refresh web part without refreshing page in SharePoint.


Load multiple JavaScript files in SharePoint JSLink

To load multiple JavaScript files in SharePoint JSLink, insert a pipe symbol between multiple JavaScript file links in the JSLink field of webpart’s properties.

JSLink Field Example:

A piple symbo is a “|” without quotes


Load scripts in SharePoint within custom Javascript or Workflow

Following is the code which can be used to load JavaScript in sequence.

This code for example loads the reputation.js from SharePoint’s layouts folder & jQuery from site assets.