Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

JSON column formatting

$
0
0

Hello,

I'm trying to add a button in a column in my SharePoint list which when clicked will redirect the user to another page based on the title of the item selected, but whenever I add a pattern which will be matched to the title the button disappears. i have checked the JSON and the pattern for errors but found none.

Can anyone help me figure out what i have missed?

Here is the code i am working with:-

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
  "elmType": "a",
  "txtContent": "Weekly Focus",
  "style": {
    "background-color": "Lightgray",
    "color": "blue",
    "padding": "5px",
    "margin": "2px"
  },
  "attributes": {
    "target": "_blank",
    "iconName": "OpenInNewWindow",
    "background-color": "red",
    "class": "sp-field-quickAction",
    "href": {
      "operator": "?",
      "operands": [
        {
          "operator": "==",
          "operands": [
            {
"operator": "toString()",
"operands": [
"[$Title]"
              ]
            },
{
"type":"string",
"pattern":"/.*(Foundation).*/"
}
]
        },
        {
          "operator": "+",
          "operands": [
            "/sites/Clients/SitePages/Week%20Focus.aspx?Status=",
            "[$ID]"
          ]
        },
        {
          "operator": "+",
          "operands": [
            "/sites/ClientNotes/SitePages/New%20Page.aspx?Status=",
            "[$ID]"
          ]
        }
      ]
    }
  }
}

Thanks


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>