0

I have added a button to a row in a list that can trigger a workflow. I would like it to set a field before running the flow. Do actions in JSON run synchronously? Can you run multiple actions?

This was my attempt but does not work.

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "button",
  "txtContent": "Publish",
  "customRowAction": {
    "action": "executeFlow",
    "actionParams": "{\"id\": \"6e4dc9d8-30ed-4123-ae8a-4b9ce24c2209\",\"headerText\":\"Copy To Enterprise\",\"runFlowButtonText\":\"Publish\"}",
    "action": "setValue",
    "actionInput": {
      "PublishStatus": "Published"
    }
  },
  "style": {
    "background-color": "#008082",
    "color": "white",
    "border-radius": "0 15px"
  }
}

2 Answers 2

1

As per the JSON schema: https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json,

customRowAction is an object which supports only one of the supported actions.

So, you cannot execute multiple actions on single button click.

3
  • 1
    I'll take your word for it. I'm new to JSON and the schema documentation doesn't mean much to me. Oct 17, 2022 at 10:54
  • 1
    Does anyone know if multiple actions are still not supported as at August 2023? It would be really helpful if we could do a setValue (to set a column value immediately) and then an executeFlow (to run a flow after that). Aug 1 at 0:17
  • Unfortunately, still not supported. Aug 1 at 5:58
1

https://learn.microsoft.com/en-us/sharepoint/dev/declarative-customization/formatting-advanced

{
  "elmType": "div",
  "txtContent": "[$FieldName]",
  "customRowAction":{
    "action": "setValue",
    "actionInput": {
      "FieldInternalName_1": "FieldValue_1",
      "FieldInternalName_2": "FieldValue_2",
      "FieldInternalName_3": "=if([$Status] == 'Completed', 'yes', 'no')"
    }
  }
}
1
  • 1
    It will just updated the fields, it will not run the flow after updating field/column values. May 4 at 11:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.