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