Hi, @John Adams ,
For using JSON formatting to trigger flow, we in fact have no need to pass the parameters like item id and folder path. And actually we are not able to do so. We only have the following parameters available in this custom action.
The actionParams attribute can have the following options when using the executeFlow action:
id: ID of the Flow to launch (required)
headerText: Sets the text at the top of the flow panel (optional)
runFlowButtonText: Sets the text of the primary button in the flow panel (optional)
And we can set the flow trigger to be things like For the selected item/file. Then adding a Get file properties or Get item action will provide most of the information we need. Here is a demo I made in my end, the action provides most of the properties.
Plus, for the conditional part, here is one thing you need pay attention to. For the "actionParams" , the id of the Flow is a required parameter. Thus it is not supported to provide a null value attempting to disable this button.
One workaround works in my end is using the visibility property. By setting the button to be hidden, we can disable it based on your required conditional statements.
I made a bit change on your original JSON, you can take it as a reference.
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
"elmType": "button",
"customRowAction": {
"action": "executeFlow",
"actionParams": "{\"id\": \"f5b1cae3-1210-4026-bf7e-c6198b76a0b2\"}"
},
"attributes": {
"class": "=if(@me == @currentField.email, 'ms-fontColor-themePrimary ms-fontWeight-semibold', '')"
},
"style": {
"border": "none",
"background-color": "transparent",
"cursor": "pointer",
"visibility": "=if(@me == @currentField.email,'visible','hidden')"
},
"children": [
{
"elmType": "span",
"attributes": {
"iconName": "=if(@me == @currentField.email,'Pin','')"
},
"style": {
"padding-right": "6px"
}
}
]
}
You can see only the last file has the pin button in the manager column which I set it as the current user I log in.
If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.