SOLVED

Sharepoint online list button "actionParams" : syntax for multiple flow id

Copper Contributor

Hello,

On Sharepoint list, i use a button to launch a powerautomate flow.
I want to launch a different flow, function from status column value.
I dont know how to write the actionParams condition in json.

 

My last try didn't work : 

"actionParams":  "={\"id\": \"+if([$Validation]== 'Refused','9b82dc01-891a-489c-b7bc-768cac9c2209\','ca3ce1e0-8145-40ca-8074-5d76b9f9e8d9\'+"}"

 

I can't use a single flow because in a case, the user may select a value in a list (ca3ce1e0-8145-40ca-8074-5d76b9f9e8d9) and in the other case there is nothing to select (9b82dc01-891a-489c-b7bc-768cac9c2209)

Thanks by advance.

3 Replies

@Leclercq_Loic You cannot run multiple flows at a time using actionParams. You might be able to add condition to run either of flow based on column values.

 

Can you add the complete JSON code in your question & I will reply back with updated JSON for your requirements?


Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

best response confirmed by Leclercq_Loic (Copper Contributor)
Solution

@Leclercq_Loic You can create two flow buttons & show/hide them based on column values.

For Example: 

 

{
    "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
    "elmType": "div",
    "children": [
        {
            "elmType": "button",
            "txtContent": "Flow 1",
            "style": {
                "display": "=if([$Validation] == 'Refused', 'block', 'none')"
            },
            "customRowAction": {
                "action": "executeFlow",
                "actionParams": "{\"id\":\"9b82dc01-891a-489c-b7bc-768cac9c2209\", \"headerText\":\"Flow A\",\"runFlowButtonText\":\"Run Flow A\"}"
            }
        },
        {
            "elmType": "button",
            "txtContent": "Flow 2",
            "style": {
                "display": "=if([$Validation] == 'Refused', 'none', 'block')"
            },
            "customRowAction": {
                "action": "executeFlow",
                "actionParams": "{\"id\":\"ca3ce1e0-8145-40ca-8074-5d76b9f9e8d9\", \"headerText\":\"It's Flow Time!\",\"runFlowButtonText\":\"Do it\"}"
            }
        }
    ]
}

 

Output

ganeshsanap_0-1661944984036.png


Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

1 best response

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

@Leclercq_Loic You can create two flow buttons & show/hide them based on column values.

For Example: 

 

{
    "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
    "elmType": "div",
    "children": [
        {
            "elmType": "button",
            "txtContent": "Flow 1",
            "style": {
                "display": "=if([$Validation] == 'Refused', 'block', 'none')"
            },
            "customRowAction": {
                "action": "executeFlow",
                "actionParams": "{\"id\":\"9b82dc01-891a-489c-b7bc-768cac9c2209\", \"headerText\":\"Flow A\",\"runFlowButtonText\":\"Run Flow A\"}"
            }
        },
        {
            "elmType": "button",
            "txtContent": "Flow 2",
            "style": {
                "display": "=if([$Validation] == 'Refused', 'none', 'block')"
            },
            "customRowAction": {
                "action": "executeFlow",
                "actionParams": "{\"id\":\"ca3ce1e0-8145-40ca-8074-5d76b9f9e8d9\", \"headerText\":\"It's Flow Time!\",\"runFlowButtonText\":\"Do it\"}"
            }
        }
    ]
}

 

Output

ganeshsanap_0-1661944984036.png


Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

View solution in original post