SharePoint List Web Part - Column Formatting Links

%3CLINGO-SUB%20id%3D%22lingo-sub-1068286%22%20slang%3D%22en-US%22%3ESharePoint%20List%20Web%20Part%20-%20Column%20Formatting%20Links%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1068286%22%20slang%3D%22en-US%22%3E%3CP%3EThis%20post%20is%20meant%20to%20address%20why%20the%20column%20formatting%20for%26nbsp%3B%22target%22%3A%20%22_blank%22%20doesn't%20work%20in%20the%20SharePoint%20list%20web%20part.%3CBR%20%2F%3E%3CBR%20%2F%3EI%20have%20a%20SharePoint%20lists%20which%20has%20the%20Title%20column%20formatted%20to%20open%20a%20link.%20The%20JSON%20is%20set%20to%20open%20the%20link%20in%20a%20new%20tab.%20This%20functionality%20works%20when%20viewing%20the%20list%20itself%2C%20but%20when%20I%20put%20it%20on%20a%20page%20using%20a%20List%20Web%20Part%2C%20the%20link%20opens%20in%20the%20same%20tab.%3CBR%20%2F%3E%3CBR%20%2F%3EThe%20real%20problem%20is%20when%20the%20link%20doesn't%20open%20in%20a%20new%20tab%2C%20after%20SharePoint%20navigates%2C%20the%20quick%20launch%20isn't%20updating%20to%20the%20subsite's%20navigation.%20I've%20seen%20posts%20on%20this%20specific%20issue%20before%20as%20well.%20The%20partial%20page%20loading%2Fcaching%20must%20be%20causing%20this.%20The%20two%20issues%20are%20somewhat%20unrelated.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%7B%3CBR%20%2F%3E%20%20%22%24schema%22%3A%20%22https%3A%2F%2Fdeveloper.microsoft.com%2Fjson-schemas%2Fsp%2Fv2%2Fcolumn-formatting.schema.json%22%2C%3CBR%20%2F%3E%20%20%22elmType%22%3A%20%22a%22%2C%3CBR%20%2F%3E%20%20%22txtContent%22%3A%20%22%40currentField%22%2C%3CBR%20%2F%3E%20%20%22attributes%22%3A%20%7B%3CBR%20%2F%3E%20%20%20%20%22target%22%3A%20%22_blank%22%2C%3CBR%20%2F%3E%20%20%20%20%22href%22%3A%20%22%3D'%5BMySiteUrl%5D%2Fsites%2Fops%2F%5BmySubSiteName%5D'%20%2B%20%5B%24ID%5D%20%2B%20'%2FSitePages%2FHome.aspx'%22%3CBR%20%2F%3E%20%20%7D%3CBR%20%2F%3E%7D%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1068286%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EBUG%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EColumn%20Formatting%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Elink%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EList%20Web%20Part%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1068304%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%20List%20Web%20Part%20-%20Column%20Formatting%20Links%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1068304%22%20slang%3D%22en-US%22%3EI%20also%20noticed%20that%20when%20I%20set%20the%20link%20to%20just%20%22http%22%20rather%20than%20%22https%22%20it%20would%20open%20in%20a%20new%20tab.%3C%2FLINGO-BODY%3E
New Contributor

This post is meant to address why the column formatting for "target": "_blank" doesn't work in the SharePoint list web part.

I have a SharePoint lists which has the Title column formatted to open a link. The JSON is set to open the link in a new tab. This functionality works when viewing the list itself, but when I put it on a page using a List Web Part, the link opens in the same tab.

The real problem is when the link doesn't open in a new tab, after SharePoint navigates, the quick launch isn't updating to the subsite's navigation. I've seen posts on this specific issue before as well. The partial page loading/caching must be causing this. The two issues are somewhat unrelated.

 

{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "a",
"txtContent": "@currentField",
"attributes": {
"target": "_blank",
"href": "='[MySiteUrl]/sites/ops/[mySubSiteName]' + [$ID] + '/SitePages/Home.aspx'"
}
}

 

1 Reply
I also noticed that when I set the link to just "http" rather than "https" it would open in a new tab.