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 use the if stat...
Power Automate
Answered

How to use the if statement

(0) ShareShare
ReportReport
Posted on by 86

Hi,

 

 if (equals (1, 1),'yes','no') I want to do nothing when no, but if I delete'no', I get an error.

 

What should I do?

Categories:
  • CFernandes Profile Picture
    8,504 Most Valuable Professional on at

    Hey Mate,

     

    You can use a simple condition block -  In the NO "leave it empty" or just terminate the Flow.

     

    CFernandes_0-1643016961048.png

     

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

     

    P.S. take a look at my blog here and like & subscribe to my YouTube Channel thanks.

  • Bird Profile Picture
    86 on at

    Hi, @CFernandes 

    How can I write in an expression?

    no.PNG

  • Bird Profile Picture
    86 on at

    Hi @CFernandes ,

    I have an additional question,

    Isn't it possible to use an OR statement in an IF statement like

    if(equals('A'),or('A','a')),'yes', 'no')
  • CFernandes Profile Picture
    8,504 Most Valuable Professional on at
  • Bird Profile Picture
    86 on at

     

     Hi @CFernandes ,

    Since there are so many conditional branches, I would like to write a description that can be written in one line if possible, but is it possible?

     

  • CFernandes Profile Picture
    8,504 Most Valuable Professional on at

    @Bird You will need to use the Graphical User Interface and create your condition.

     

    You can Add Group or a Row -

     

    CFernandes_1-1643023755506.png

     

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

     

    P.S. take a look at my blog here and like & subscribe to my YouTube Channel thanks.

     

     

  • Bird Profile Picture
    86 on at
    I want to write Excel columns when yes in each condition, but I do not want to use condition because it is very difficult to make conditional branches by the number of columns.

      Hi @CFernandes ,

     

  • Verified answer
    CU-18081211-6 Profile Picture
    9,272 Moderator on at

     @Bird ,

    1.For your first question.

    In PowerAutomate, the if function requires  the else branch. So no matter what, the if should look like:

     If(condition, trueBranch, falseBranch)

    To avoid one or the other branch, you simply use null value like:

    If(condition ,null , falseBranch)

    or

    If(condition, trueBranch, null)

    1. For the second question.

    This approach is not valid in PowerAutomate as Or operator expects 2 boolean parameters. In your example, you used Or with 2 strings.

    If(equals('A'),or('A','a')),'yes', 'no')

    In this case, there are at least two way to achieve your goal, of course, you can choose your solution based on flow scenario:

    if(contains(variables('Array'),'A'),'yes', 'no')

    (where variable Array is an array previously defined as ["A","a"])

    or

    if(contains('Aa','A'),'yes', 'no')

    Hope it helps !

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 302 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 263

#3
Henil Profile Picture

Henil 115

Last 30 days Overall leaderboard