Skip to main content
added 229 characters in body
Source Link
Ganesh Sanap - MVP
  • 47.4k
  • 22
  • 32
  • 64

Generally, the URL of document/file in library will be in format:

https://contoso.sharepoint.com/sites/SPConnect/Shared%20Documents/Document.docx 

When you hit above URL in browser, browser may download it instead of opening it online in browser. So, you have to use the link like:

https://contoso.sharepoint.com/sites/SPConnect/Shared%20Documents/Document.docx?Web=1 

Where, Shared%20Documents is URL name of document library and Document.docx is file name.

So, you have to use the JSON in this format:

{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "a", "txtContent": "@currentField", "attributes": { "target": "_blank", "href": "='https://contoso.sharepoint.com/sites/SPConnect/Shared%20Documents/' + [$Field1] + '-' + [$Field2] + '-' + [$Field3] + '.docx?Web=1'" } } 

Where [$Field1] + '-' + [$Field2] + '-' + [$Field3] + '.docx should be valid file name/path.

Also, you have to use the correct internal names of columns Field1, Field2 and Field3 in JSON. You can get the internal name of your columns by following this article: How to find the Internal name of columns in SharePoint Online?

Documentation: SharePoint JSON column formatting


Update from comments:

It seems you are trying to open the folder inside document library using hyperlink. In that case, try using below JSON:

{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "a", "txtContent": "@currentField", "attributes": { "target": "_blank", "href": "='https://contoso.sharepoint.com/sites/SPConnect/Shared%20Documents/File%20Container/' + [$InternalNameOfFileReference] + '-' + [$InternalNameOfMatterCategory] + '-' + [$InternalNameOfMatterName]'" } } 

Use correct internal namesinternal names of columns in JSON.

If there is no value in a column where you are applying this JSON, use JSON like this:

{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "a", "txtContent": "Link to folder", "attributes": { "target": "_blank", "href": "='https://xxxx.sharepoint.com/sites/SPSite/Shared%20Documents/File%20Container/' + [$OTContainer] + '-' + [$MatterCategory] + '-' + [$Title]'" } } 

Generally, the URL of document/file in library will be in format:

https://contoso.sharepoint.com/sites/SPConnect/Shared%20Documents/Document.docx 

When you hit above URL in browser, browser may download it instead of opening it online in browser. So, you have to use the link like:

https://contoso.sharepoint.com/sites/SPConnect/Shared%20Documents/Document.docx?Web=1 

Where, Shared%20Documents is URL name of document library and Document.docx is file name.

So, you have to use the JSON in this format:

{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "a", "txtContent": "@currentField", "attributes": { "target": "_blank", "href": "='https://contoso.sharepoint.com/sites/SPConnect/Shared%20Documents/' + [$Field1] + '-' + [$Field2] + '-' + [$Field3] + '.docx?Web=1'" } } 

Where [$Field1] + '-' + [$Field2] + '-' + [$Field3] + '.docx should be valid file name/path.

Also, you have to use the correct internal names of columns Field1, Field2 and Field3 in JSON.

Documentation: SharePoint JSON column formatting


Update from comments:

It seems you are trying to open the folder inside document library using hyperlink. In that case, try using below JSON:

{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "a", "txtContent": "@currentField", "attributes": { "target": "_blank", "href": "='https://contoso.sharepoint.com/sites/SPConnect/Shared%20Documents/File%20Container/' + [$InternalNameOfFileReference] + '-' + [$InternalNameOfMatterCategory] + '-' + [$InternalNameOfMatterName]'" } } 

Use correct internal names of columns in JSON.

If there is no value in a column where you are applying this JSON, use JSON like this:

{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "a", "txtContent": "Link to folder", "attributes": { "target": "_blank", "href": "='https://xxxx.sharepoint.com/sites/SPSite/Shared%20Documents/File%20Container/' + [$OTContainer] + '-' + [$MatterCategory] + '-' + [$Title]'" } } 

Generally, the URL of document/file in library will be in format:

https://contoso.sharepoint.com/sites/SPConnect/Shared%20Documents/Document.docx 

When you hit above URL in browser, browser may download it instead of opening it online in browser. So, you have to use the link like:

https://contoso.sharepoint.com/sites/SPConnect/Shared%20Documents/Document.docx?Web=1 

Where, Shared%20Documents is URL name of document library and Document.docx is file name.

So, you have to use the JSON in this format:

{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "a", "txtContent": "@currentField", "attributes": { "target": "_blank", "href": "='https://contoso.sharepoint.com/sites/SPConnect/Shared%20Documents/' + [$Field1] + '-' + [$Field2] + '-' + [$Field3] + '.docx?Web=1'" } } 

Where [$Field1] + '-' + [$Field2] + '-' + [$Field3] + '.docx should be valid file name/path.

Also, you have to use the correct internal names of columns Field1, Field2 and Field3 in JSON. You can get the internal name of your columns by following this article: How to find the Internal name of columns in SharePoint Online?

Documentation: SharePoint JSON column formatting


Update from comments:

It seems you are trying to open the folder inside document library using hyperlink. In that case, try using below JSON:

{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "a", "txtContent": "@currentField", "attributes": { "target": "_blank", "href": "='https://contoso.sharepoint.com/sites/SPConnect/Shared%20Documents/File%20Container/' + [$InternalNameOfFileReference] + '-' + [$InternalNameOfMatterCategory] + '-' + [$InternalNameOfMatterName]'" } } 

Use correct internal names of columns in JSON.

If there is no value in a column where you are applying this JSON, use JSON like this:

{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "a", "txtContent": "Link to folder", "attributes": { "target": "_blank", "href": "='https://xxxx.sharepoint.com/sites/SPSite/Shared%20Documents/File%20Container/' + [$OTContainer] + '-' + [$MatterCategory] + '-' + [$Title]'" } } 
added 484 characters in body
Source Link
Ganesh Sanap - MVP
  • 47.4k
  • 22
  • 32
  • 64

Generally, the URL of document/file in library will be in format:

https://contoso.sharepoint.com/sites/SPConnect/Shared%20Documents/Document.docx 

When you hit above URL in browser, browser may download it instead of opening it online in browser. So, you have to use the link like:

https://contoso.sharepoint.com/sites/SPConnect/Shared%20Documents/Document.docx?Web=1 

Where, Shared%20Documents is URL name of document library and Document.docx is file name.

So, you have to use the JSON in this format:

{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "a", "txtContent": "@currentField", "attributes": { "target": "_blank", "href": "='https://contoso.sharepoint.com/sites/SPConnect/Shared%20Documents/' + [$Field1] + '-' + [$Field2] + '-' + [$Field3] + '.docx?Web=1'" } } 

Where [$Field1] + '-' + [$Field2] + '-' + [$Field3] + '.docx should be valid file name/path.

Also, you have to use the correct internal names of columns Field1, Field2 and Field3 in JSON.

Documentation: SharePoint JSON column formatting


Update from comments:

It seems you are trying to open the folder inside document library using hyperlink. In that case, try using below JSON:

{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "a", "txtContent": "@currentField", "attributes": { "target": "_blank", "href": "='https://contoso.sharepoint.com/sites/SPConnect/Shared%20Documents/File%20Container/' + [$InternalNameOfFileReference] + '-' + [$InternalNameOfMatterCategory] + '-' + [$InternalNameOfMatterName]'" } } 

Use correct internal names of columns in JSON.

If there is no value in a column where you are applying this JSON, use JSON like this:

{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "a", "txtContent": "Link to folder", "attributes": { "target": "_blank", "href": "='https://xxxx.sharepoint.com/sites/SPSite/Shared%20Documents/File%20Container/' + [$OTContainer] + '-' + [$MatterCategory] + '-' + [$Title]'" } } 

Generally, the URL of document/file in library will be in format:

https://contoso.sharepoint.com/sites/SPConnect/Shared%20Documents/Document.docx 

When you hit above URL in browser, browser may download it instead of opening it online in browser. So, you have to use the link like:

https://contoso.sharepoint.com/sites/SPConnect/Shared%20Documents/Document.docx?Web=1 

Where, Shared%20Documents is URL name of document library and Document.docx is file name.

So, you have to use the JSON in this format:

{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "a", "txtContent": "@currentField", "attributes": { "target": "_blank", "href": "='https://contoso.sharepoint.com/sites/SPConnect/Shared%20Documents/' + [$Field1] + '-' + [$Field2] + '-' + [$Field3] + '.docx?Web=1'" } } 

Where [$Field1] + '-' + [$Field2] + '-' + [$Field3] + '.docx should be valid file name/path.

Also, you have to use the correct internal names of columns Field1, Field2 and Field3 in JSON.

Documentation: SharePoint JSON column formatting


Update from comments:

It seems you are trying to open the folder inside document library using hyperlink. In that case, try using below JSON:

{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "a", "txtContent": "@currentField", "attributes": { "target": "_blank", "href": "='https://contoso.sharepoint.com/sites/SPConnect/Shared%20Documents/File%20Container/' + [$InternalNameOfFileReference] + '-' + [$InternalNameOfMatterCategory] + '-' + [$InternalNameOfMatterName]'" } } 

Use correct internal names of columns in JSON.

Generally, the URL of document/file in library will be in format:

https://contoso.sharepoint.com/sites/SPConnect/Shared%20Documents/Document.docx 

When you hit above URL in browser, browser may download it instead of opening it online in browser. So, you have to use the link like:

https://contoso.sharepoint.com/sites/SPConnect/Shared%20Documents/Document.docx?Web=1 

Where, Shared%20Documents is URL name of document library and Document.docx is file name.

So, you have to use the JSON in this format:

{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "a", "txtContent": "@currentField", "attributes": { "target": "_blank", "href": "='https://contoso.sharepoint.com/sites/SPConnect/Shared%20Documents/' + [$Field1] + '-' + [$Field2] + '-' + [$Field3] + '.docx?Web=1'" } } 

Where [$Field1] + '-' + [$Field2] + '-' + [$Field3] + '.docx should be valid file name/path.

Also, you have to use the correct internal names of columns Field1, Field2 and Field3 in JSON.

Documentation: SharePoint JSON column formatting


Update from comments:

It seems you are trying to open the folder inside document library using hyperlink. In that case, try using below JSON:

{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "a", "txtContent": "@currentField", "attributes": { "target": "_blank", "href": "='https://contoso.sharepoint.com/sites/SPConnect/Shared%20Documents/File%20Container/' + [$InternalNameOfFileReference] + '-' + [$InternalNameOfMatterCategory] + '-' + [$InternalNameOfMatterName]'" } } 

Use correct internal names of columns in JSON.

If there is no value in a column where you are applying this JSON, use JSON like this:

{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "a", "txtContent": "Link to folder", "attributes": { "target": "_blank", "href": "='https://xxxx.sharepoint.com/sites/SPSite/Shared%20Documents/File%20Container/' + [$OTContainer] + '-' + [$MatterCategory] + '-' + [$Title]'" } } 
added 777 characters in body
Source Link
Ganesh Sanap - MVP
  • 47.4k
  • 22
  • 32
  • 64

Generally, the URL of document/file in library will be in format:

https://contoso.sharepoint.com/sites/SPConnect/Shared%20Documents/Document.docx 

When you hit above URL in browser, browser may download it instead of opening it online in browser. So, you have to use the link like:

https://contoso.sharepoint.com/sites/SPConnect/Shared%20Documents/Document.docx?Web=1 

Where, Shared%20Documents is URL name of document library and Document.docx is file name.

So, you have to use the JSON in this format:

{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "a", "txtContent": "@currentField", "attributes": { "target": "_blank", "href": "='https://contoso.sharepoint.com/sites/SPConnect/Shared%20Documents/' + [$Field1] + '-' + [$Field2] + '-' + [$Field3] + '.docx?Web=1'" } } 

Where [$Field1] + '-' + [$Field2] + '-' + [$Field3] + '.docx should be valid file name/path.

Also, you have to use the correct internal names of columns Field1, Field2 and Field3 in JSON.

Documentation: SharePoint JSON column formatting


Update from comments:

It seems you are trying to open the folder inside document library using hyperlink. In that case, try using below JSON:

{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "a", "txtContent": "@currentField", "attributes": { "target": "_blank", "href": "='https://contoso.sharepoint.com/sites/SPConnect/Shared%20Documents/File%20Container/' + [$InternalNameOfFileReference] + '-' + [$InternalNameOfMatterCategory] + '-' + [$InternalNameOfMatterName]'" } } 

Use correct internal names of columns in JSON.

Generally, the URL of document/file in library will be in format:

https://contoso.sharepoint.com/sites/SPConnect/Shared%20Documents/Document.docx 

When you hit above URL in browser, browser may download it instead of opening it online in browser. So, you have to use the link like:

https://contoso.sharepoint.com/sites/SPConnect/Shared%20Documents/Document.docx?Web=1 

Where, Shared%20Documents is URL name of document library and Document.docx is file name.

So, you have to use the JSON in this format:

{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "a", "txtContent": "@currentField", "attributes": { "target": "_blank", "href": "='https://contoso.sharepoint.com/sites/SPConnect/Shared%20Documents/' + [$Field1] + '-' + [$Field2] + '-' + [$Field3] + '.docx?Web=1'" } } 

Where [$Field1] + '-' + [$Field2] + '-' + [$Field3] + '.docx should be valid file name/path.

Also, you have to use the correct internal names of columns Field1, Field2 and Field3 in JSON.

Documentation: SharePoint JSON column formatting

Generally, the URL of document/file in library will be in format:

https://contoso.sharepoint.com/sites/SPConnect/Shared%20Documents/Document.docx 

When you hit above URL in browser, browser may download it instead of opening it online in browser. So, you have to use the link like:

https://contoso.sharepoint.com/sites/SPConnect/Shared%20Documents/Document.docx?Web=1 

Where, Shared%20Documents is URL name of document library and Document.docx is file name.

So, you have to use the JSON in this format:

{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "a", "txtContent": "@currentField", "attributes": { "target": "_blank", "href": "='https://contoso.sharepoint.com/sites/SPConnect/Shared%20Documents/' + [$Field1] + '-' + [$Field2] + '-' + [$Field3] + '.docx?Web=1'" } } 

Where [$Field1] + '-' + [$Field2] + '-' + [$Field3] + '.docx should be valid file name/path.

Also, you have to use the correct internal names of columns Field1, Field2 and Field3 in JSON.

Documentation: SharePoint JSON column formatting


Update from comments:

It seems you are trying to open the folder inside document library using hyperlink. In that case, try using below JSON:

{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "a", "txtContent": "@currentField", "attributes": { "target": "_blank", "href": "='https://contoso.sharepoint.com/sites/SPConnect/Shared%20Documents/File%20Container/' + [$InternalNameOfFileReference] + '-' + [$InternalNameOfMatterCategory] + '-' + [$InternalNameOfMatterName]'" } } 

Use correct internal names of columns in JSON.

Source Link
Ganesh Sanap - MVP
  • 47.4k
  • 22
  • 32
  • 64
Loading