cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
emmahuynh
Helper II
Helper II

Update Button when Clicked in SP List Item

I have a button in SP list item. when user clicks on "Send for Approval" button, it triggers the event to run Flow and send email to others. I want to update the button from " Send for Approval" to "Request Sent" when user clicks the button. That case, we will know which rows the user sent email to others and which rows the user hasn't sent email.

basically, could be an else if condition: If user clicks the button => change to "Request Sent" else 'keep the text the same as Send for Approval'

emmahuynh_0-1614892899661.png

here is the code in JSON for this column. 

{
"elmType": "button",
"txtContent": "Send for Approval",
"customRowAction": {
"action": "executeFlow",
"actionParams": "{\"id\": \"3bd8a3d9-311c-46ec-9c09-a2ccc2a62b8a\"}"
},
"style": {
"background-color": "#468259",
"color": "white"
}
}
Thank you
 
1 ACCEPTED SOLUTION

Accepted Solutions
Expiscornovus
Super User II
Super User II

Hi @emmahuynh,

 

In addition to @ChristianAbata his approach you can also amend the current column formatting example and use a operator to set the visibility.

 

Below is an example of that.

 

This does require the creation of an additional choice column (Button Request Status) with the values Send for Approval and Request Sent. However, you can hide that column from your view.

 

 

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "button",
  "txtContent": "Send for Approval",
  "customRowAction": {
    "action": "executeFlow",
    "actionParams": "{\"id\": \"3bd8a3d9-311c-46ec-9c09-a2ccc2a62b8a\"}"
  },
  "style": {
    "background-color": "#468259",
    "color": "white",
    "visibility": {
      "operator": "?",
      "operands": [
        {
          "operator": "==",
          "operands": [
            "[$ButtonRequestStatus]",
            "Send for Approval"
          ]
        },
        "visible",
        "hidden"
      ]
    }
  }
}

 

 

buttonrequeststatus.png

 

Within the flow setup you can use an update item to set Button Request Status to Request Sent. This will make sure that the button is hidden.

requestsent.png

View solution in original post

2 REPLIES 2
ChristianAbata
Super User II
Super User II

hi @emmahuynh  I think you need a cannvas app



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA
Expiscornovus
Super User II
Super User II

Hi @emmahuynh,

 

In addition to @ChristianAbata his approach you can also amend the current column formatting example and use a operator to set the visibility.

 

Below is an example of that.

 

This does require the creation of an additional choice column (Button Request Status) with the values Send for Approval and Request Sent. However, you can hide that column from your view.

 

 

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "button",
  "txtContent": "Send for Approval",
  "customRowAction": {
    "action": "executeFlow",
    "actionParams": "{\"id\": \"3bd8a3d9-311c-46ec-9c09-a2ccc2a62b8a\"}"
  },
  "style": {
    "background-color": "#468259",
    "color": "white",
    "visibility": {
      "operator": "?",
      "operands": [
        {
          "operator": "==",
          "operands": [
            "[$ButtonRequestStatus]",
            "Send for Approval"
          ]
        },
        "visible",
        "hidden"
      ]
    }
  }
}

 

 

buttonrequeststatus.png

 

Within the flow setup you can use an update item to set Button Request Status to Request Sent. This will make sure that the button is hidden.

requestsent.png

View solution in original post

Helpful resources

Announcements
User Groups Public Preview

Join us for our User Group Public Preview!

Power Automate User Groups are coming! Make sure you’re among the first to know when user groups go live for public preview.

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Users online (55,008)