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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / If statement in Power ...
Power Apps
Unanswered

If statement in Power Apps for values within range

(0) ShareShare
ReportReport
Posted on by 184

Hello, so I have a power app created (see attachment Powerapps1.jpg) where % Acid is a text input which is a number while % Acid Min and % Acid Max are dropdowns which is a lookup from a product selected from a sharepoint list. Same goes with % Salt.

I need a formula in conforms which is a text input/label which will have this if statement:

if value in % Acid is < % Acid Min and >% Acid Max and if value in % Salt is < % Salt Min and > % Salt Max then conforms is a "No", if it is within range for both then it is a "Yes".

This has to be true for both Acid and Salt, so if one of them is not within the min and max values then conforms is a No.

 

I started trying a formula for Acid (see PowerApps 2.jpg), however, it is throwing an error. If I put there =, there is no error, but if I put the < or > sign, it throws an error. Appreciate your help.

Categories:
I have the same question (0)
  • Maria_FPO Profile Picture
    6 on at

    hello,

     

    I guess that you have to convert yours fields to a numbers. Try use the "Value" function.
    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-value

     

     

     

     

  • CatPagulayan Profile Picture
    184 on at

    Hi @Maria_FPO , 

    do you have a suggestion on the formula in powerapps for my concern? I tried if(value(aciddatacardvalue.text < dropdown_acidmin.selected.result, "no") but still it does not work.

  • Maria_FPO Profile Picture
    6 on at

    Hi,

    Try this : If(Value(aciddatacardvalue.text) < Value(dropdown_acidmin.selected.result), "no")

  • CatPagulayan Profile Picture
    184 on at

    hello @Maria_FPO , tried it but doesn't work either 😞

  • Verified answer
    v-yutliu-msft Profile Picture
    on at

    Hi @CatPagulayan ,

    Do you mean that:

    1)the controls for % Acid Min , % Acid Max ,% Salt Min, > % Salt Max are drop downs?

    2) % Acid Min , % Acid Max % ,Salt Min, > % Salt Max are lookup fields?

    3)the formulas in the items of these four drop downs?

    I assume that these are all lookup fields.

    Then please set like this:

    1)drop down for % Acid Min:

    Choices(listname.'% Acid Min')

    drop down for % Acid Max:

     

    Choices(listname.'% Acid Max')

     

    drop down for % Salt Min:

     

    Choices(listname.'% Salt Min')

     

    drop down for % Salt Max:

     

    Choices(listname.'% Salt Max')

     

    2)the label's Text:

     If(Value(aciddatacardvalue.Text) >= Value(dropdown_acidmin.Selected.Value)&&
     Value(aciddatacardvalue.Text) <= Value(dropdown_acidmax.Selected.Value)&&
     Value(saltdatacardvalue.Text) >= Value(dropdown_saltmin.Selected.Value)&&
     Value(saltdatacardvalue.Text) <= Value(dropdown_saltmax.Selected.Value),
    "yes",
    "no"
    )
    

     

     

     

    Best regards,

  • CatPagulayan Profile Picture
    184 on at

    thanks @v-yutliu-msft ! exactly helped! O just changed the && to || ant worked like a charm 😊

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard