Forum Discussion
MeShare685
Jun 10, 2022Copper Contributor
Button to trigger Flow in link to SharePoint item
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 lis...
- Jun 13, 2022
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:
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.
MeShare685
Jun 13, 2022Copper Contributor
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:
This is the display form of the list item:
ganeshsanap
Jun 13, 2022MVP
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:
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.
- nathanisaacsonMay 12, 2023Copper Contributor
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.
- ganeshsanapMay 14, 2023MVP
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 formsPlease consider giving Like if my post helped you in any way.
- nathanisaacsonMay 15, 2023Copper ContributorReally 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.
- MeShare685Jun 13, 2022Copper ContributorThat worked! Thank you!