Forum Discussion
sboley
Jul 26, 2024Copper Contributor
Using Conditional Formatting to make a field blank if another field is blank
I have a document library where I would like one column (Reject) to be blank if another column (Reject Reason) is blank. Can I use conditional formatting to do this? Here is my current JSON on th...
- Jul 26, 2024
sboley you can do this with the following JSON, changing the details to your own of course. It is the visibility property you need to use to display or hide the button that runs the flow.
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "button", "txtContent": "Change Owner", "customRowAction": { "action": "executeFlow", "actionParams": "='{\"id\":\"5eddbaca-e7df-46f4-b968-f009ed9f69ec\", \"headerText\":\" ' + [$Title] + '\",\"runFlowButtonText\":\"Go\"}'" }, "style": { "background-color": "#fff5dd", "border-radius": "10px", "visibility": "=if([$Reason] =='', 'hidden', 'visible')" } }Rob
Los Gallardos
Microsoft Power Automate Community Super User.
Principal Consultant, SharePoint and Power Platform WSP Global (and classic 1967 Morris Traveller driver)
Rob_Elliott
Jul 26, 2024Silver Contributor
sboley you can do this with the following JSON, changing the details to your own of course. It is the visibility property you need to use to display or hide the button that runs the flow.
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "button",
"txtContent": "Change Owner",
"customRowAction": {
"action": "executeFlow",
"actionParams": "='{\"id\":\"5eddbaca-e7df-46f4-b968-f009ed9f69ec\", \"headerText\":\" ' + [$Title] + '\",\"runFlowButtonText\":\"Go\"}'"
},
"style": {
"background-color": "#fff5dd",
"border-radius": "10px",
"visibility": "=if([$Reason] =='', 'hidden', 'visible')"
}
}
Rob
Los Gallardos
Microsoft Power Automate Community Super User.
Principal Consultant, SharePoint and Power Platform WSP Global (and classic 1967 Morris Traveller driver)
sboley
Jul 29, 2024Copper Contributor
Rob_Elliott this worked perfectly, thank you!