web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to include the log...
Power Automate
Unanswered

How to include the logical AND/OR operators in conditionals

(1) ShareShare
ReportReport
Posted on by 28

I would like to know how to include the logical AND/OR operators in conditionals, previously on WinAutomation this could be achieved like this:

 

The AND "&&" operator can be used inside an "If" condition using the following format

 

First Operand: %TextVar_1 == "ABC" && TextVar_2 == "DEF"%

Operator: =

Second Operand: True

 

The OR "||" operator can be used in a similar way

 

First Operand: %TextVar_1 == "ABC" || TextVar_2 == "DEF"%

Operator: =

Second Operand: True

 

I have tried to express it in this way in Power Automate Desktop and it is not working.

 

In my case I am reading a single cell value from excel which is stored into the variable %ExcelData%, I would like to use an If conditional to review if the variable's value is either "Payer" or "Doc" I need it to do certain actions, but if it is blank I need it to go into a different set of actions.

 

I have already tried to express it in different ways but I haven't been able to achieve this logic, this is what I have tried so far:

 

First Operand: %ExcelData = "Payer" || ExcelData = "Doc"%

Operator: =

Second Operand: True

 

With the above conditional I get an Invalid Value message, you might have noticed I removed the double equal signs, I have tried with the double equal signs and it also says invalid value in this way.

 

First Operand: %ExcelData = 'payer'% || %ExcelData = 'doc'%

Operator: =

Second Operand: True

 

The above conditional is accepted by PAD but when I run it it doesn't seem to be working as intended as it is not realizing that the cell value is actually Payer.

 

 

 

 

 

 

 

 

I have the same question (0)
  • adijain Profile Picture
    Microsoft Employee on at

    Hello @AlanYC ,

     

    Thank you for bringing this issue to us. We will investigate this further on our end and get back to you with the correct syntax for using AND/OR operators. For now, could you please instead use the workaround of using two if conditions to verify the ExcelData var for both 'Payer' and 'Doc' separately. 

     

    Thanks for trying out Power Automate Desktop!

  • AlanYC Profile Picture
    28 on at

    Thank you, I will wait for your reply. I am currently using the workaround that you mentioned of creating two separate conditionals.

  • adijain Profile Picture
    Microsoft Employee on at

    Hi @AlanYC,

     

    Please find the syntax for the logical AND/OR operators in PAD conditionals below:

    • AND instead of && 
    • OR instead of ||
    • = instead of ==

    Example:

    temp.JPG

     

    Please let us know if you have any further questions.

     

    Thanks,

    Aditya

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Good afternoon @adijain , I'm Efrain from Panama. 

     

    I'm Developer, but at the same I'm new in Power Automate. And I need to know the next info:

    I was trying use this logic but I have question. Can I use the second operand as result? This question is because I need to do a comparison of two variables, but I need the result as TRUE or FALSE value.

     

    I'm testing new apps to my company, and one these apps POD. 

     

    Regards.

  • miketran13 Profile Picture
    720 on at

    Thanks a lot for this Adijain, it was thing I am looking for. It helps a lot and can reduce the complexity of my process.

     

    Regards,

    Mike

  • Henrik_M Profile Picture
    2,021 Super User 2024 Season 1 on at

    Use a Set variable to write the result of a boolean expression into something to use later.

  • adijain Profile Picture
    Microsoft Employee on at

    HI @efrainC_Onq, thanks for the question, you would need to set the first operand as a variable, like what @Henrik_M  suggested and then that variable will have the result as True or False - as shown below:

    adijain_0-1611747090334.png

    In above, the %NewVar% will have either True or False value.  Hope it makes sense. 

  • vtse Profile Picture
    on at

    Hi,

    try the following

     

    set the two values payer and doc as variables var1 and var2

    then use the if action as following 

    First operand    %ExcelData== var1 || ExcelData== var2%

    operator equals (=)

    second operator TRUE

  • TomaszPoszytek Profile Picture
    170 Most Valuable Professional on at

    Hi,

     

    this should be:

     

    First Operand: %ExcelData = 'payer'% || %ExcelData = 'doc'%

    Operator: =

    Second Operand: %True%

  • ericcho Profile Picture
    2 on at

    To expand on this topic....what is the proper notation for operators that are not straight up equals?

    For example I want to quality something that contains "payer" or startswith "doc"

    ....something along the lines of:

     

    %contains(ExcelData,'payer') OR startswith(ExcelData,'doc')%

     

    Thanks in advance

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 796

#2
Valantis Profile Picture

Valantis 671

#3
Haque Profile Picture

Haque 551

Last 30 days Overall leaderboard