SOLVED

Button to trigger Flow in link to SharePoint item

Copper Contributor

Hello!

 

I have a button in a SharePoint list column that triggers an approval flow for a selected item.  It's a regular single line of text column.

 

When you open the item in the SharePoint list, or open a link to the item, the button isn't there.  It's just a blank text field.  I want to be able to email the link to the item, and let the receipt click the button to run the flow when editing the item, instead of giving them access to the entire list.  Is there currently a way to accomplish this?

 

Thanks in advance!

9 Replies

@MeShare685 Create a flow button in list using JSON column formatting. Flow button will be shown in list view as well as "display" form of list item (<siteUrl>/lists/listName/dispform.aspx?ID=1.

 

Follow this Microsoft official documentation for more information: Create a button to launch a Flow  


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.

@ganeshsanap  Hi, thanks for answering my question.  I might be missing something, but the button is not showing in the display form of the list item.  I've attached pictures.

This is the list view:

MeShare685_0-1655127641085.png

This is the display form of the list item:

MeShare685_1-1655127693726.png

 

 

best response confirmed by MeShare685 (Copper Contributor)
Solution

@MeShare685 Ah, seems there is some problem with this JSON when text field is empty. Try adding some default value for your single line of text column from column settings like: 

ganeshsanap_0-1655130223743.png


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.

That worked! Thank you!

@ganeshsanap I'm attempting to do the same thing and have gotten to this step, but even when there is text in the field (and the button is subsequently displayed) it does not let me select the button.  It just resorts back to editing the existing test in the field.

@nathanisaacson Can you share the JSON code you are using? Is it working fine in list view and not working on list forms?

Maybe some limitation with JSON formatting while using customRowAction on list forms


Please consider giving Like if my post helped you in any way.

Really appreciate the quick response. Here's the JSON code:

{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "button",
"customRowAction": {
"action": "executeFlow",
"actionParams": "{\"id\": \"dc80743b-1d07-45f3-aa1b-62ab32b9f22f\"}"
},
"attributes": {
"class": "ms-fontColor-themePrimary ms-fontColor-themeDarker--hover"
},
"style": {
"border": "none",
"background-color": "transparent",
"cursor": "pointer"
},
"children": [
{
"elmType": "span",
"attributes": {
"iconName": "AcceptMedium"
},
"style": {
"padding-right": "6px"
}
},
{
"elmType": "span",
"txtContent": "Submit to VRAP"
}
]
}

You are correct, it is working fine in the list view but not in the individual display view. For context: the button appears like normal in the individual display view (when there's text in the free text box) but when I go to click on it, it reverts to editing the free text field instead of allowing me to select the link.

@nathanisaacson I think this is a limitation of SharePoint online JSON formatting.

 

Check this thread for more information: Add Button to SharePoint Form JSON 


Please consider giving a Like if my post helped you in any way.

Ah ok, so it appears this is not possible then. I wonder if @MeShare685 was able to accomplish it successfully. Either way, I appreciate your help on this!
1 best response

Accepted Solutions
best response confirmed by MeShare685 (Copper Contributor)
Solution

@MeShare685 Ah, seems there is some problem with this JSON when text field is empty. Try adding some default value for your single line of text column from column settings like: 

ganeshsanap_0-1655130223743.png


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.

View solution in original post