Forum Discussion
Conditional JSON formatting of button in SharePoint List
- Apr 18, 2019
{
"elmType": "button",
"txtContent": "Get Approved",
"customRowAction": {
"action": "executeFlow",
"actionParams": "{\"id\":\"86dfdf10-8d99-4914-8e98-fe4b21ed7e34\"}"
},
"style": {
"background-color": "purple",
"color": "white",
"visibility": "=if(([$ModerationStatus] == 'Pending') && ([$DocumentType] == 'Offer'),'visible','hidden')"
}}
check this sample .. I got rid of the Operator and used a simple if statement. only change to visibility property.
{
"elmType": "button",
"txtContent": "Get Approved",
"customRowAction": {
"action": "executeFlow",
"actionParams": "{\"id\":\"86dfdf10-8d99-4914-8e98-fe4b21ed7e34\"}"
},
"style": {
"background-color": "purple",
"color": "white",
"visibility": "=if(([$ModerationStatus] == 'Pending') && ([$DocumentType] == 'Offer'),'visible','hidden')"
}
}
check this sample .. I got rid of the Operator and used a simple if statement. only change to visibility property.
Maruthi Gadde Peter_K rolanddaane RobElliott evaristo1904
I use the same method as you to run a flow. The flow pane pop up to the left, user click run, but the button is still visible until page manually refresh (and the approval status is changed by the flow).
I want to show users that the flow is started, it could be have a visibility check that remove button, column with status "sent for approval" etc.
If json formatting could handle two action it has not been any problem, executeflow and setvalue, but as far as I understand it just handle one action.