SOLVED

Is it possible to reference a list item value for headerText in actionParams

Copper Contributor

I'd like to reference a list item's column value in actionParams headerText.

In the code below I want the value of list column Purpose to be displayed in the headerText :   [$Purpose]

Is it possible to acheive this?

 

 

 

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
  "elmType": "button",
  "txtContent": "Req update",
  "customRowAction": {
    "action": "executeFlow",
    "actionParams": "{\"id\":\"6876124d-ff27-47df-a446-06b9c64ed95a\", \"headerText\":\"Request update to [$Purpose]\",\"runFlowButtonText\":\"Send update request\"}"
  }
}

 

 

 

2 Replies
best response confirmed by Xv (Copper Contributor)
Solution

@Xv 

Yes! You can do this using an expression that builds the escaped JSON needed for the actionParams. It's a bit confusing to look at with all of the escaped quotes, but it works!

 

The actionParams property can be set with an expression. In this case we are going to treat the whole thing like text by surrounding our escaped JSON value with single quotes. Then we can add our dynamic value as part of that text. So we can take your format and adjust the property value to an expression like this:

 

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
  "elmType": "button",
  "txtContent": "Req update",
  "customRowAction": {
    "action": "executeFlow",
    "actionParams": "='{\"id\":\"6876124d-ff27-47df-a446-06b9c64ed95a\", \"headerText\":\"Request update to ' + [$Purpose] + '\",\"runFlowButtonText\":\"Send update request\"}'"
  }
}

 

@Chris Kent that works really well, thanks.

 

Rob
Los Gallardos
Microsoft Power Automate Community Super User

1 best response

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

@Xv 

Yes! You can do this using an expression that builds the escaped JSON needed for the actionParams. It's a bit confusing to look at with all of the escaped quotes, but it works!

 

The actionParams property can be set with an expression. In this case we are going to treat the whole thing like text by surrounding our escaped JSON value with single quotes. Then we can add our dynamic value as part of that text. So we can take your format and adjust the property value to an expression like this:

 

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
  "elmType": "button",
  "txtContent": "Req update",
  "customRowAction": {
    "action": "executeFlow",
    "actionParams": "='{\"id\":\"6876124d-ff27-47df-a446-06b9c64ed95a\", \"headerText\":\"Request update to ' + [$Purpose] + '\",\"runFlowButtonText\":\"Send update request\"}'"
  }
}

 

View solution in original post