1

I would like to make an alternative text in a hyperlink column bigger.

In a title column, it works fine with this code:

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "a",
  "txtContent": "@currentField",
  "style": {
    "font-size": "13pt"
  }
}

But when I paste this into hyperlink column, it does nothing or the column is broken.

My hypothesis is that the elmType is set wrong.

Anyone know how to solve it?

0
1

Try using below JSON:

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "a",
  "txtContent": "@currentField.desc",
  "style": {
    "font-size": "13pt"
  },
  "attributes": {
    "href": "@currentField"
  }
}

Output:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.