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 / IF " is empty " on mul...
Power Automate
Answered

IF " is empty " on multiple vars

(0) ShareShare
ReportReport
Posted on by

Hi All,

 

Scenario :

Flow runs producing values as it goes.

Variable     Value

%Var1%        1

%Var2%        abcd

%Var3%   

 

Vars 1+2 have a value but Var 3 is empty

 

If  %Var1%,%Var2%,%Var3%   is empty

 

Basically if just one of the vars is empty do this, Else...

On testing im getting isnt empty from the above scenario but one is empty.

Can accomplish this but needs more if's etc, quicker way ?

 

Thanks all.

 

 

Screenshot 2022-02-24 181717.png

I have the same question (0)
  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    Here Mike,

     

    [List of available 8 functions]

    • Contains(VAR'KEY', False)
    • NotContains(VAR'KEY', False)
    • IsEmpty(VAR)
    • IsNotEmpty(VAR)
    • StartsWith(VAR'KEY', False)
    • NotStartsWith(VAR'KEY', False)
    • EndsWith(VAR'KEY', False)
    • NotEndsWith(VAR'KEY', False)

     

    This is from @Anonymous here:

    https://powerusers.microsoft.com/t5/Power-Automate-Desktop/How-to-include-the-logical-AND-OR-operators-in-conditionals/td-p/715982

     

    So, it looks like you want this in the first operand section:

     

    First operand:  %IsEmpty(Var1) OR IsEmpty(Var2) OR IsEmpty(Var3)

    Operator:  Equals to (=)

    Send operand:  FALSE

     

    Good luck!  I've never tried it.  Just knew I'd seen it before.

  • UK_Mike Profile Picture
    on at

    Hi Mike,

     

    Correct syntax below ???, tried both ways, result not as expected...both ways...

    %IsEmpty(Var1)% OR %IsEmpty(Var2)% OR %IsEmpty(Var3)%

    %IsEmpty(Var1) OR IsEmpty(Var2) OR IsEmpty(Var3)%

    Operator:  Equals to (=)

    Second operand:  FALSE

     

    My three vars are a date, a word and a numeric.

     

    Quick one, setting an empty var is %""% ?

     

    Thanks pal.

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    I believe an empty variable is %''%...that's 2 apostrophes, not a single quotation.

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    I was hoping this would work for you.  If it is not working, then the long option is to evaluate each one separately and Skip the flow at any point one is empty.  Example:

     

    'Start of flow of up until ready for valuation

    If %Var1% IsEmpty

        Go to Subflow: Skip

    End (If)

    If %Var2% IsEmpty

        Go to Subflow: Skip

    End (If)

    If %Var3% IsEmpty

        Go to Subflow: Skip

    End (If)

    'the rest of the flow

     

     

    In the Subflow, tell it what you want it to do, be it shutdown the bot or whatever.  If you are in a Loop, instead of "Go to Subflow, you could just say "Next".

     

    Good luck!

     

  • UK_Mike Profile Picture
    on at

    Only posted I had 3 vars but theres actually 13, I was wanting to avoid another 13 ifs within an if within an if within an if within an if 😂

    Will try it again over the weekend, if Putin hasnt invaded ☹️

     

    Will report back, thanks again 👋

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    Fortunately, they don't have to be within each other 🙂

     

    Keep your head down!

  • Highboy Profile Picture
    1,187 Super User 2024 Season 1 on at

    Highboy_0-1645978982317.png

    This will go into the first part of the IF

    Highboy_1-1645979085305.png

    This will go into the Else part

    Highboy_2-1645979128102.png

    You can putt all your 13 variables into one line. 😊

     

  • UK_Mike Profile Picture
    on at

    Hey buddy, thanks for that but getting a syntax error your way, please double check ive got it right 😁

     

    In my shot, vars a, b and c have empty values.

    Running the first if with below code comes back as not empty, however the 3 single ifs come back as empty.

    Just to recap, im trying to achieve whether a single var is empty, preferably putting all these vars into a single line.

     

     

    %IsEmpty(a) OR IsEmpty(b) OR IsEmpty(c)%   set to %False%   doesnt work.

    %IsEmpty(a) OR IsEmpty(b) OR IsEmpty(c)%   set to %True%    works provided they are ALL empty.

    Ive already done all the ifs (13) as I just couldnt figure it out, took less time than this post lol 🤣

    But would be nice to know, thanks again.

     

     

    Screenshot 2022-02-27 165922.png

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

    %a <> " AND b <> " AND b <> "%

     

    Screenshot 2022-02-27 171919.png

  • Verified answer
    Highboy Profile Picture
    1,187 Super User 2024 Season 1 on at

    You are not doing it the same way...
    Check you messages.

  • UK_Mike Profile Picture
    on at

    Many thanks for this 👌, for anyone "remotely" interested...

     

    %(Test1 = '') AND (Test2 = '') AND (Test3 = '')%

    Note must be 2 single quotes, not doubles !!!

     

     

    Screenshot 2022-02-27 185803.png

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 247 Super User 2026 Season 2

#2
11manish Profile Picture

11manish 164 Super User 2026 Season 2

#3
trice602 Profile Picture

trice602 138 Super User 2026 Season 2

Last 30 days Overall leaderboard