JSON Formatting button to start workflow, not initiating run command.

Copper Contributor

In a SharePoint list I use the json code below on a column (Register)  to initiate a workflow when clicking on the button.

When I add the code to the formatting of the list's Gallery view, it opens the item in Edit Mode, instead of starting the workflow.

 

{
"elmType": "span",
"style": {
"color": "#0078d7"
},
"children": [
{
"elmType": "span",
"attributes": {
"iconName": "Flow"
}
},
{
"elmType": "button",
"style": {
"background-color": "transparent",
"color": "#0078d7",
"cursor": "pointer"
},
"txtContent": "Register",
"customRowAction": {
"action": "executeFlow",
"actionParams": "{\"id\": \"653381c7-37b5-41b7-b429-cf99287ebac2\"}"
}
}
]
}

 

1 Reply

@AlbertSP The JSON code you have provided in your question is for specific column formatting and not for view formatting.

 

Are you trying to implement it in gallery/tiles view instead of normal list/table view? If yes, you can refer JSON formatting applied on column directly inside your view formatting using columnFormatterReference like: 

 

{
  "columnFormatterReference": "[$FieldName]"
}

 

Where FieldName is internal name of your column. You can get the internal name of your column by following this article: How to find the Internal name of columns in SharePoint Online? 


Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.