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 / If statement in Power ...
Power Apps
Answered

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.

Powerapps 2.JPG
Powerapps 1.JPG
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
    Microsoft Employee 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

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 530

#2
WarrenBelz Profile Picture

WarrenBelz 459 Most Valuable Professional

#3
Haque Profile Picture

Haque 314

Last 30 days Overall leaderboard