Skip to main content


Copilot Studio - General

create an expression

Posted on by 151

hello, please your help ...
I need to create a flow that sends an email indicating the final status of a task carried out by different areas and that is registered in a sharepoint list according to the following:


task    type              team 1     team 2        team 3 ......   team 8
task1  normal          ok            pending      pending      rejected
task2  emergency   pending   ok                ok                ok


so I have tried to initialize a variable according to the following conditions:

for normal type tasks:
- if one of the teams rejects, the task will be rejected
- for the task to be ok, all teams must be ok
- while one of the teams is pending (and the task is not rejected), the task will be pending
for emergency tasks, the task will always be ok ...


The logic that I have tried to apply is the following: (as if it were excel)

if (
or (team 1 = "rejected", team 2 = "rejected", ... team 8 = "rejected"), "rejected",
if (and (team 1 = "ok", team 2 = "ok", ... team 8 = "ok"), "ok",
if (type = "emergency"; "ok"; "pending")
but I have not managed to translate this logic as an expression of automated

  • jgarciac Profile Picture
    jgarciac 151 on at
    Re: create an expression

    Excellent, thank you very much, after struggling a bit with the parentheses, I left it as indicated, only the "type" evaluated it out so as not to make the expression even more difficult..



  • Verified answer
    renatoromao Profile Picture
    renatoromao 6,762 on at
    Re: create an expression

    Hi @jgarciac ,


    Here is a Power Virtual Agents Community, your questions are related to Power Automate.

    I recommend you to create a question inside the Power Automate community because the users can help you better.


    Your expression is very complex, but when you are using the expressions and and or  you cannot use more than two parameters inside the function.

    Basically your expression needs to do similar to my expression.

    Ps: the red text you need to fix it.


    This documentation can help you.


    if (
    or(or(or (equals(team 1, "rejected"), equals(team 2, "rejected"), or (equals(team 3, "rejected"), equals(team 4, "rejected"))  ... team 8 = "rejected")), "rejected",
    if (and (team 1 = "ok", team 2 = "ok", ... team 8 = "ok"), "ok",
    if (type = "emergency"; "ok"; "pending")


Helpful resources

Quick Links

Exciting News for Copilot Studio Communi…

Get ready to experience a whole new level of engagement with the Copilot Studio…

Celebrating the May Super User of the…

LaurensM is an exceptional contributor to the Power Platform Community…

Check out the Copilot Studio Cookbook…

We are excited to announce our new Copilot Cookbook Gallery in the Community…


WarrenBelz Profile Picture

WarrenBelz 137,998

RandyHayes Profile Picture

RandyHayes 76,308

Pstork1 Profile Picture

Pstork1 63,059