{"id":1018,"date":"2013-10-29T21:41:08","date_gmt":"2013-10-30T04:41:08","guid":{"rendered":"https:\/\/mmman.itgroove.net\/?p=1018"},"modified":"2023-02-24T21:48:38","modified_gmt":"2023-02-24T21:48:38","slug":"the-trick-to-getting-js-link-to-work-in-sharepoint","status":"publish","type":"post","link":"https:\/\/regroove.ca\/archive\/2013\/10\/29\/the-trick-to-getting-js-link-to-work-in-sharepoint\/","title":{"rendered":"The Trick to Getting JS Link to Work in SharePoint"},"content":{"rendered":"<p>There have been a number of times I\u2019ve forgotten that there\u2019s a kind of black magic going on with the JS Link field in SharePoint List Views.&nbsp; I\u2019m writing this mostly to remind myself of how to do it properly, but also to help anyone else out there who may be running into the same issue.<\/p>\n<p>Essentially, depending on where you have your JS file stored in your SharePoint site \/ site collection the URL will be in the form of one of two possibilities.<\/p>\n<p>1) For a JS file in a local site, you would use the format:<\/p>\n<p>~site\/_catalogs\/masterpage\/[filename].js<\/p>\n<p>2) And for a file in a subsite, but using the site collection\u2019s masterpage library, you would use the following format instead:<\/p>\n<p>~sitecollection\/_catalogs\/masterpage\/[filename].js<\/p>\n<p>An example (using the ~site reference) can be seen below.<\/p>\n<p><a href=\"https:\/\/mmman.itgroove.net\/wp-content\/uploads\/mmman\/2013\/10\/SNAGHTML7d07b5f.png\"><img loading=\"lazy\" decoding=\"async\" title=\"SNAGHTML7d07b5f\" style=\"border-top: 0px;border-right: 0px;border-bottom: 0px;padding-top: 0px;padding-left: 0px;border-left: 0px;padding-right: 0px\" border=\"0\" alt=\"SNAGHTML7d07b5f\" src=\"http:\/\/mmman.itgroove.net\/wp-content\/uploads\/mmman\/2013\/10\/SNAGHTML7d07b5f_thumb.png\" width=\"272\" height=\"373\"><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>There have been a number of times I\u2019ve forgotten that there\u2019s a kind of black magic going on with the JS Link field in SharePoint List Views.&nbsp; I\u2019m writing this mostly to remind myself of how to do it properly, but also to help anyone else out there who may be running into the same &hellip; <a href=\"https:\/\/regroove.ca\/archive\/2013\/10\/29\/the-trick-to-getting-js-link-to-work-in-sharepoint\/\"><\/a><\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[20,4,7],"tags":[],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>The Trick to Getting JS Link to Work in SharePoint - Archive<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/regroove.ca\/archive\/2013\/10\/29\/the-trick-to-getting-js-link-to-work-in-sharepoint\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"The Trick to Getting JS Link to Work in SharePoint - Archive\" \/>\n<meta property=\"og:description\" content=\"There have been a number of times I\u2019ve forgotten that there\u2019s a kind of black magic going on with the JS Link field in SharePoint List Views.&nbsp; I\u2019m writing this mostly to remind myself of how to do it properly, but also to help anyone else out there who may be running into the same &hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/regroove.ca\/archive\/2013\/10\/29\/the-trick-to-getting-js-link-to-work-in-sharepoint\/\" \/>\n<meta property=\"og:site_name\" content=\"Archive\" \/>\n<meta property=\"article:published_time\" content=\"2013-10-30T04:41:08+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-02-24T21:48:38+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/mmman.itgroove.net\/wp-content\/uploads\/mmman\/2013\/10\/SNAGHTML7d07b5f_thumb.png\" \/>\n<meta name=\"author\" content=\"Colin Phillips (Alumni)\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Colin Phillips (Alumni)\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/regroove.ca\/archive\/2013\/10\/29\/the-trick-to-getting-js-link-to-work-in-sharepoint\/\",\"url\":\"https:\/\/regroove.ca\/archive\/2013\/10\/29\/the-trick-to-getting-js-link-to-work-in-sharepoint\/\",\"name\":\"The Trick to Getting JS Link to Work in SharePoint - Archive\",\"isPartOf\":{\"@id\":\"https:\/\/regroove.ca\/archive\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/regroove.ca\/archive\/2013\/10\/29\/the-trick-to-getting-js-link-to-work-in-sharepoint\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/regroove.ca\/archive\/2013\/10\/29\/the-trick-to-getting-js-link-to-work-in-sharepoint\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/mmman.itgroove.net\/wp-content\/uploads\/mmman\/2013\/10\/SNAGHTML7d07b5f_thumb.png\",\"datePublished\":\"2013-10-30T04:41:08+00:00\",\"dateModified\":\"2023-02-24T21:48:38+00:00\",\"author\":{\"@id\":\"https:\/\/regroove.ca\/archive\/#\/schema\/person\/adeb0df1cc7a862160be620ca7eace1b\"},\"breadcrumb\":{\"@id\":\"https:\/\/regroove.ca\/archive\/2013\/10\/29\/the-trick-to-getting-js-link-to-work-in-sharepoint\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/regroove.ca\/archive\/2013\/10\/29\/the-trick-to-getting-js-link-to-work-in-sharepoint\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/regroove.ca\/archive\/2013\/10\/29\/the-trick-to-getting-js-link-to-work-in-sharepoint\/#primaryimage\",\"url\":\"http:\/\/mmman.itgroove.net\/wp-content\/uploads\/mmman\/2013\/10\/SNAGHTML7d07b5f_thumb.png\",\"contentUrl\":\"http:\/\/mmman.itgroove.net\/wp-content\/uploads\/mmman\/2013\/10\/SNAGHTML7d07b5f_thumb.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/regroove.ca\/archive\/2013\/10\/29\/the-trick-to-getting-js-link-to-work-in-sharepoint\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog Archive\",\"item\":\"https:\/\/regroove.ca\/archive\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"The Trick to Getting JS Link to Work in SharePoint\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/regroove.ca\/archive\/#website\",\"url\":\"https:\/\/regroove.ca\/archive\/\",\"name\":\"Archive\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/regroove.ca\/archive\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/regroove.ca\/archive\/#\/schema\/person\/adeb0df1cc7a862160be620ca7eace1b\",\"name\":\"Colin Phillips (Alumni)\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/regroove.ca\/archive\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/14eeab0d377e9630e0983d9c08911979?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/14eeab0d377e9630e0983d9c08911979?s=96&d=mm&r=g\",\"caption\":\"Colin Phillips (Alumni)\"},\"url\":\"https:\/\/regroove.ca\/archive\/author\/cphillips\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"The Trick to Getting JS Link to Work in SharePoint - Archive","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/regroove.ca\/archive\/2013\/10\/29\/the-trick-to-getting-js-link-to-work-in-sharepoint\/","og_locale":"en_US","og_type":"article","og_title":"The Trick to Getting JS Link to Work in SharePoint - Archive","og_description":"There have been a number of times I\u2019ve forgotten that there\u2019s a kind of black magic going on with the JS Link field in SharePoint List Views.&nbsp; I\u2019m writing this mostly to remind myself of how to do it properly, but also to help anyone else out there who may be running into the same &hellip;","og_url":"https:\/\/regroove.ca\/archive\/2013\/10\/29\/the-trick-to-getting-js-link-to-work-in-sharepoint\/","og_site_name":"Archive","article_published_time":"2013-10-30T04:41:08+00:00","article_modified_time":"2023-02-24T21:48:38+00:00","og_image":[{"url":"http:\/\/mmman.itgroove.net\/wp-content\/uploads\/mmman\/2013\/10\/SNAGHTML7d07b5f_thumb.png"}],"author":"Colin Phillips (Alumni)","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Colin Phillips (Alumni)","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/regroove.ca\/archive\/2013\/10\/29\/the-trick-to-getting-js-link-to-work-in-sharepoint\/","url":"https:\/\/regroove.ca\/archive\/2013\/10\/29\/the-trick-to-getting-js-link-to-work-in-sharepoint\/","name":"The Trick to Getting JS Link to Work in SharePoint - Archive","isPartOf":{"@id":"https:\/\/regroove.ca\/archive\/#website"},"primaryImageOfPage":{"@id":"https:\/\/regroove.ca\/archive\/2013\/10\/29\/the-trick-to-getting-js-link-to-work-in-sharepoint\/#primaryimage"},"image":{"@id":"https:\/\/regroove.ca\/archive\/2013\/10\/29\/the-trick-to-getting-js-link-to-work-in-sharepoint\/#primaryimage"},"thumbnailUrl":"http:\/\/mmman.itgroove.net\/wp-content\/uploads\/mmman\/2013\/10\/SNAGHTML7d07b5f_thumb.png","datePublished":"2013-10-30T04:41:08+00:00","dateModified":"2023-02-24T21:48:38+00:00","author":{"@id":"https:\/\/regroove.ca\/archive\/#\/schema\/person\/adeb0df1cc7a862160be620ca7eace1b"},"breadcrumb":{"@id":"https:\/\/regroove.ca\/archive\/2013\/10\/29\/the-trick-to-getting-js-link-to-work-in-sharepoint\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/regroove.ca\/archive\/2013\/10\/29\/the-trick-to-getting-js-link-to-work-in-sharepoint\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/regroove.ca\/archive\/2013\/10\/29\/the-trick-to-getting-js-link-to-work-in-sharepoint\/#primaryimage","url":"http:\/\/mmman.itgroove.net\/wp-content\/uploads\/mmman\/2013\/10\/SNAGHTML7d07b5f_thumb.png","contentUrl":"http:\/\/mmman.itgroove.net\/wp-content\/uploads\/mmman\/2013\/10\/SNAGHTML7d07b5f_thumb.png"},{"@type":"BreadcrumbList","@id":"https:\/\/regroove.ca\/archive\/2013\/10\/29\/the-trick-to-getting-js-link-to-work-in-sharepoint\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Archive","item":"https:\/\/regroove.ca\/archive\/"},{"@type":"ListItem","position":2,"name":"The Trick to Getting JS Link to Work in SharePoint"}]},{"@type":"WebSite","@id":"https:\/\/regroove.ca\/archive\/#website","url":"https:\/\/regroove.ca\/archive\/","name":"Archive","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/regroove.ca\/archive\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/regroove.ca\/archive\/#\/schema\/person\/adeb0df1cc7a862160be620ca7eace1b","name":"Colin Phillips (Alumni)","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/regroove.ca\/archive\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/14eeab0d377e9630e0983d9c08911979?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/14eeab0d377e9630e0983d9c08911979?s=96&d=mm&r=g","caption":"Colin Phillips (Alumni)"},"url":"https:\/\/regroove.ca\/archive\/author\/cphillips\/"}]}},"_links":{"self":[{"href":"https:\/\/regroove.ca\/archive\/wp-json\/wp\/v2\/posts\/1018"}],"collection":[{"href":"https:\/\/regroove.ca\/archive\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/regroove.ca\/archive\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/regroove.ca\/archive\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/regroove.ca\/archive\/wp-json\/wp\/v2\/comments?post=1018"}],"version-history":[{"count":1,"href":"https:\/\/regroove.ca\/archive\/wp-json\/wp\/v2\/posts\/1018\/revisions"}],"predecessor-version":[{"id":1904,"href":"https:\/\/regroove.ca\/archive\/wp-json\/wp\/v2\/posts\/1018\/revisions\/1904"}],"wp:attachment":[{"href":"https:\/\/regroove.ca\/archive\/wp-json\/wp\/v2\/media?parent=1018"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/regroove.ca\/archive\/wp-json\/wp\/v2\/categories?post=1018"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/regroove.ca\/archive\/wp-json\/wp\/v2\/tags?post=1018"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}