Custom column formatting supported schemes
-
16-02-2021 - |
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"
}
}
}
Solution
Quote from Microsoft:
You can't use column formatting to output links to protocols other than http://, https://, or mailto:.
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange