Feb 22 2022 09:21 AM
Hello,
I have a column in a SP library with the following Json. I'm wondering if there is a way to make the button "hidden" and not clickable based on another column? I need this button to only show and be clickable in rows where the column [$ApprovalLink] is not None. I imagine something like an IF that applies the Json if Approval Link is not None but if it is None if just makes it blank or act blank? Is this possible?
Feb 22 2022 10:15 PM
Solution@SG523 there's a simpler JSON code that you can use and where you set the visibility property:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "button",
"txtContent": "Publish to Teams",
"customRowAction": {
"action": "executeFlow",
"actionParams": "='{\"id\":\"021ec4e0-8f85-46b3-a557-a4456960a4eb\", \"headerText\":\"Publish ' + [$Title] + '\",\"runFlowButtonText\":\"Publish now\"}'"
},
"style": {
"background-color": "#008082",
"color": "white",
"border-radius": "10px",
"visibility": "=if([$PublishedToTeams] == 'Yes','hidden','visible')"
}
}
The result is:
Rob
Los Gallardos
Intranet, SharePoint and Power Platform Manager (and classic 1967 Morris Traveller driver)
Feb 23 2022 05:16 AM
Feb 22 2022 10:15 PM
Solution@SG523 there's a simpler JSON code that you can use and where you set the visibility property:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "button",
"txtContent": "Publish to Teams",
"customRowAction": {
"action": "executeFlow",
"actionParams": "='{\"id\":\"021ec4e0-8f85-46b3-a557-a4456960a4eb\", \"headerText\":\"Publish ' + [$Title] + '\",\"runFlowButtonText\":\"Publish now\"}'"
},
"style": {
"background-color": "#008082",
"color": "white",
"border-radius": "10px",
"visibility": "=if([$PublishedToTeams] == 'Yes','hidden','visible')"
}
}
The result is:
Rob
Los Gallardos
Intranet, SharePoint and Power Platform Manager (and classic 1967 Morris Traveller driver)