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

%3CLINGO-SUB%20id%3D%22lingo-sub-1846038%22%20slang%3D%22en-US%22%3EIs%20it%20possible%20to%20reference%20a%20list%20item%20value%20for%20headerText%20in%20actionParams%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1846038%22%20slang%3D%22en-US%22%3E%3CP%3EI'd%20like%20to%20reference%20a%20list%20item's%20column%20value%20in%20actionParams%20headerText.%3C%2FP%3E%0A%3CP%3EIn%20the%20code%20below%20I%20want%20the%20value%20of%20list%20column%20Purpose%20to%20be%20displayed%20in%20the%20headerText%20%3A%26nbsp%3B%20%26nbsp%3B%5B%24Purpose%5D%20%3CBR%20%2F%3E%3CBR%20%2F%3EIs%20it%20possible%20to%20acheive%20this%3F%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-json%22%3E%3CCODE%3E%7B%0A%20%20%22%24schema%22%3A%20%22https%3A%2F%2Fdeveloper.microsoft.com%2Fjson-schemas%2Fsp%2Fcolumn-formatting.schema.json%22%2C%0A%20%20%22elmType%22%3A%20%22button%22%2C%0A%20%20%22txtContent%22%3A%20%22Req%20update%22%2C%0A%20%20%22customRowAction%22%3A%20%7B%0A%20%20%20%20%22action%22%3A%20%22executeFlow%22%2C%0A%20%20%20%20%22actionParams%22%3A%20%22%7B%5C%22id%5C%22%3A%5C%226876124d-ff27-47df-a446-06b9c64ed95a%5C%22%2C%20%5C%22headerText%5C%22%3A%5C%22Request%20update%20to%20%5B%24Purpose%5D%5C%22%2C%5C%22runFlowButtonText%5C%22%3A%5C%22Send%20update%20request%5C%22%7D%22%0A%20%20%7D%0A%7D%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1846038%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ELists%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Frequent Visitor

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

@HangryMapache 

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