2

I'm trying to include a rich text column in this code. How do I reference the rich text column?

  "elmType": "a",
  "attributes": {
    "iconName": "Mail",
    "class": "sp-field-quickActions",
    "href": {
      "operator": "+",
      "operands": [
        "mailto:",
        "kunde@epost.no",
        "?subject=Task status&body=",
        **"@currentField"**
      ]
    }
  }
2

Rich text fields can be referenced like any other field. If this formatting is on this field then the use of @currentField should work just fine as shown below:

{
  "elmType": "a",
  "txtContent": "Send Mail",
  "attributes": {
    "iconName": "Mail",
    "class": "sp-field-quickActions",
    "href": {
      "operator": "+",
      "operands": [
        "mailto:",
        "kunde@epost.no",
        "?subject=Task status&body=",
        "@currentField"
      ]
    }
  }
}

If it's in another field you can reference it as [$internalname]

Keep in mind, however, that rich text fields are generally pretty terrible for use in list formatting. This use case may be just fine, however.

1
  • Looks like it works after all. My problem was the length of the text in the field. When it's to long it doesn't create an email when you click on the icon. When I shorten the text it comes up with the html representation of the text :-( Excample: <div class="ExternalClassF5FA304978AF4B179F74621F03AD41C2"><span id="ms-rterangepaste-start"></span><div><div><p style="margin-top – Frank Asphaug Mar 9 '20 at 7:18

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