Flow button only correctly appears during a search in a document library

Occasional Contributor

I am trying to get a Flow button to display only when an approval status column has a set value.

 

Below is the full JSON code added to the button's column's advanced formatting and below are the two screen shots which demonstrate the problem:

 

1.  When searching in the document library  (the button displays correctly)

WarrenGibbs_0-1637166204647.png

2.  Without searching (the button displays incorrectly - i.e. button displays for all documents):

WarrenGibbs_1-1637166324864.png

 

 

{
"elmType": "button",
"customRowAction": {
"action": "executeFlow",
"actionParams": "{\"id\": \"fa1e5103-9c6e-462c-84ed-71a888001605\"}"
},
"attributes": {
"class": "ms-fontColor-themePrimary ms-fontColor-themeDarker--hover"
},
"style": {
"border": "none",
"background-color": "transparent",
"cursor": "pointer",
"display": "=if([$_ModerationStatus] == 'Approved', 'none', 'display')"
},
"children": [
{
"elmType": "span",
"attributes": {
"iconName": "Flow"
},
"style": {
"padding-right": "6px"
}
},
{
"elmType": "span",
"txtContent": "Start Sign-off"
}
]
}
 
Any ideas?
 
Thanks
Warren
0 Replies