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 Apps / Condition in flow resu...
Power Apps
Answered

Condition in flow results in true although schould be false

(0) ShareShare
ReportReport
Posted on by 518 Moderator

Hello,

i have a flow with a very simple condition.

If one of two variables is 1 than the flow should do nothing.

SLMR_1-1717517694697.png

So only if MA<>1 and Case <>1 than the result should be true, else false.

But if i am running the flow the condition always results in true

SLMR_2-1717517916364.png

 

I think it has something to do with the fact, that the variables are strings.

so i tryed '1' instead of 1
Any idea what is wrong?

Categories:
I have the same question (0)
  • TheRobRush Profile Picture
    11,128 Moderator on at

    instead of compose initialize two variables of number type and make the expression you have in the compose now surrounded by int() then see if you get same result comparing numbers to numbers? (or even keep them as composes, but surround the part in the econditional with int() [using expression]

  • SLMR Profile Picture
    518 Moderator on at

    The compose is only used to display the values of the variables.
    The variables have to be of type string.

    The valeus are set earlier in the flow.

    Within a loop they are:

    - First set to 1 (As the type is string the varible should always be string. So set variable to 1 should result in the string 1)

    - Then the variables are changed if two list_rows function (with filter ) returns  GUID's.
    This makes it easy for me to decide if there is a Case in the Case table with the specified casenummer and a User with the specified username.

     

    As both varibles are of type string i do not know what is wrong with my condition.

    In other cases i had the same problemes with booleans. Sometimes it gave the rigt result and other times not

  • TheRobRush Profile Picture
    11,128 Moderator on at

    curious, in the screenshots you create the compose actions, but in your conditional you do not reference the compose, but instead the original variables. Could this be where it goes off? Assuming the compose image was sent for a reason but it's not referenced in second ss so figured safe to ask

  • SLMR Profile Picture
    518 Moderator on at

    The compose function does nothing. 
    Without the compose functions i get the same results.

    I only included it because i wanted to show the values in the screenshot.

     

    I think i will use

    lenght(variable) not equal to 1

     

    I think although the variable is of type string setting the value of the variable to 1 will make the problem. I has the same problems with boolean variables where i compared the variable is true or not.
    And there i had the problem that it sometines worked as intendet but sometimes not.

    This is really not an diffcult task. But it took me more time than developing the whole flow, which is much more complicated.

     

    Maybe i miss something when comparing variables of a specific type.

    But i think a variable that is declared as boolean or string should always keep the type? 

  • TheRobRush Profile Picture
    11,128 Moderator on at

    yah if you created the variable via the initialize variable / set variable control wherein you specifically have to select the variable type then yes it will always be that type.

    you can reference it as others though in formulaic expression with things like int(variable) etc and it will then look at the integer value represented by the string etc in a nondestructive manner.

  • Verified answer
    SLMR Profile Picture
    518 Moderator on at

    Good morning,

    first of all thanks for your help.

     

    I now used lenght(var) not equal 1.

    Now the flow works as intendet.

    (It is because for my case it is not really important what the value the string has. I just initally set it to '1' and than it is set to GUID value from a list row result. So if no record is found it remains '1'. And as then lenght of a GUID always has lenght>1, this comparison is ok).

    Anyway i still do not 100% understand why the frist approach gives wrong results.

    I think the value of 1 is interpreted as a number and the value of the variable is of type string. But it also does not work if i use '1'. But maybe i have to use something like string(1)

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 March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 551

#2
WarrenBelz Profile Picture

WarrenBelz 430 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 298

Last 30 days Overall leaderboard