Ram
Ram

Reputation: 3

Power automate flow not getting triggered

I'm new to JSON and would like to seek some advise on following piece of code.

Scenario: In the following list, would like to trigger a flow for the selected item to move the item to another list once the approver clicks "Approve". Have nested the executeFlow action under "Approve" button. (Note: Flow ID is changed.)

List

![1]

Thank you for your help, in advance.

JSON Script:

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
  "elmType": "div",
  "style": {
    "flex-directon": "row",
    "justify-content": "left",
    "align-items": "center",
    "flex-wrap": "nowrap"
  },
  "children": [
    {
      "elmType": "div",
      "style": {
        "display": "=if([$Status] == 'In Progress', 'inherit','none')",
        "flex-directon": "row",
        "justify-content": "left",
        "align-items": "center",
        "flex-wrap": "wrap"
      },
      "children": [
        {
          "elmType": "button",
          "customRowAction": {
           "action": "executeFlow", 
            "actionParams": "{\"id\":\"0000f4409-0081-0016-b459-4f000000001dfd\"}",
            "action": "setValue",            
"actionInput": {
              "Status": "Approved",
              "ApprovalDecisionBy": "@me"
            }
          },
          "attributes": {
            "class": "ms-fontColor-themePrimary ms-fontColor-themeDarker--hover"
          },
          "style": {
            "border": "none",
            "background-color": "transparent",
            "cursor": "pointer",
            "display": "flex",
            "flex-directon": "row",
            "justify-content": "left",
            "align-items": "center",
            "flex-wrap": "wrap"
          },
          "children": [
            {
              "elmType": "span",
              "attributes": {
                "iconName": "SkypeCircleCheck"
              },
              "style": {
                "padding": "4px"
              }
            },
            {
              "elmType": "span",
              "txtContent": "Approve",
              "style": {
                "word-break": "keep-all"
              }
            }
          ]
        },
        {
          "elmType": "button",
          "customRowAction": {
            "actionInput": {
              "Status": "Not Approved",
              "ApprovalDecisionBy": "@me"
            }
          },
          "attributes": {
            "class": "ms-fontColor-themePrimary ms-fontColor-themeDarker--hover"
          },
          "style": {
            "border": "none",
            "background-color": "transparent",
            "cursor": "pointer",
            "display": "flex",
            "flex-directon": "row",
            "justify-content": "left",
            "align-items": "center",
            "flex-wrap": "wrap"
          },
          "children": [
            {
              "elmType": "span",
              "attributes": {
                "iconName": "Blocked"
              },
              "style": {
                "padding": "4px"
              }
            },
            {
              "elmType": "span",
              "txtContent": "Reject",
              "style": {
                "word-break": "keep-all"
              }
            }
          ]
        }
      ]
    },
    {
      "elmType": "div",
      "children": [
        {
          "elmType": "span",
          "txtContent": "='This item is ' + toLowerCase([$Status])",
          "style": {
            "display": "=if([$Status] == '' , 'none','inherit')",
            "padding-left": "5px",
            "word-break": "keep-all"
          }
        }
      ]
    }
  ]
}

Upvotes: 0

Views: 325

Answers (1)

Expiscornovus
Expiscornovus

Reputation: 1497

It looks like it is not allowed to use two actions in a customRowAction property of a button. When I try to add that in my json I am getting a Duplicate object key warning.

As a workaround I would suggest to simply update the Status and ApprovalDecisionBy fields from your Power Automate flow instead. You can use an update item action for that.

enter image description here

Upvotes: 0

Related Questions