Question

In a list, I'm trying to customize a column to render an hyperling that use a data: scheme (3rd party app will handle interpretation) :

{
   "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
   "elmType": "a",
   "txtContent": "@currentField",
   "attributes": {
      "target": "_blank",
      "href": "='data:text/plain;charset=utf-8,my field as text :' + @currentField"
   }
}

However, this does not works (fields renders as simple text).

Is it possible to use such url scheme ?

I'm aware I could build a field customizer, but it's a bit more complex to deploy.

Also tried :

{
    "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
    "elmType": "a",
    "txtContent": "@currentField",
    "attributes": {
        "target": "_blank",
        "href": {
            "operator": "+",
            "operands": [
                "data:text/plain;charset=utf-8",
                "my field as text :",
                "@currentField"
            ],
            "data-interception": "on"
        }
    }
}
Was it helpful?

Solution

Quote from Microsoft:

You can't use column formatting to output links to protocols other than http://, https://, or mailto:.

https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/column-formatting#create-clickable-actions

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top