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 / Auto-select Pass/Fail ...
Power Apps
Answered

Auto-select Pass/Fail by Data Input

(0) ShareShare
ReportReport
Posted on by 302

Hello Mates, the image below is that of Recipes. Each Recipes have their standard BD range. That of Omo Auto Wash shown is between 590 - 670.  What I input depends on what appears  on the Status (Pass OR Fail). Here are the condition:

If num is less than 590: Fail

If num is more than 670: Fail

If num is between 590 - 670: Pass

Virikefe22_0-1661445590503.png

Someone please help me figure out the variables to set and the conditions as well. I've made several attempts but to no available. What I'm looking at is, as soon as a value is entered into the BD datacard, it should select PASS OR FAIL in the Status card automatically.

Categories:
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Virikefe22 

    You appear to have a combobox in your form for Appearance.  

    I would assume your Items property is: ["Pass", "Fail"]

     

    Set your DefaultSelectedItems property to the following:

    {Value:
     With({_val: IfError(Value(yourBDTextInputControl.Text), 0)},
     If(_val < 590 || _val>670, "Fail", "Pass")
     )
    }

    No variables are needed.  Avoid variables as much as possible.

     

    I hope this is helpful for you.

  • Virikefe22 Profile Picture
    302 on at

    Thanks @RandyHayes 

    No, the Combox name is: Status
    Note: 
    There are several Recipes here (not just one), which has several BD ranges. If this is for one (Omo Auto Wash), what happens when I change the Recipe in the dropdown with different BD range.

    Below are the BD range for each recipe:

    Omo A : 590 - 670

    Omo Av : 500 - 600

    Omo S : 500 - 600

    RadT : 350 - 450

    SunL : 500 - 600
    So there has to be some sort of lookup to capture the range of the changed values of the Recipes.

    Meanwhile, I applied what you sent now to the Status combobox and when I input values into the BD combobox, nothing changed in the Status (Pass/Fail)

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Virikefe22 

    Going to need more information then.  You did not mention that each recipe has its own range!

     

    RandyHayes_0-1661449009569.png

     

    What is the Items property of the Dropdown number 1?  And what is the name of that control? And, is it a dropdown as it appears or a combobox?

     

    What is the name of the control (TextInput) for number 2?

     

    What is the Items property of number 3?  Is that control the one named Status?  

  • Virikefe22 Profile Picture
    302 on at

    Item properties for 1 (Recipe combobox dropdown):

    ["Omo Auto Wash(Add)", "Omo Avenger", "Omo Sunshine", "Radiant", "Sunlight Lite"]

    Name of the combobox dropdown is: DataCardValue3_1

     

    BD (2) TextInput is: DataCardValue4_1

     

    Item property for 3: ["Pass", "Fail"]

     

     

     

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Virikefe22 

    Perfect!

     

    Change your Items property on DataCardValue3_1 to:

    Table(
     {Value: "Omo Auto Wash(Add)", Lower: 590, Upper: 670},
     {Value: "Omo Avenger", Lower: 500, Upper: 600},
     {Value: "Omo Sunshine", Lower: 500, Upper: 600},
     {Value: "Radiant", Lower: 350, Upper: 450},
     {Value: "Sunlight Lite", Lower: 500, Upper: 600}
    )

     

    Then Change the DefaultSelectedItems property of Status combobox to:

    With({_val: IfError(Value(DataCardValue4_1.Text), 0)},
    
     {Value:
     If(_val < DataCardValue3_1.Selected.Lower || _val > DataCardValue3_1.Selected.Upper, "Fail", "Pass")
     }
    )
  • Virikefe22 Profile Picture
    302 on at

    It's the value entered in: BD (DataCardValue4_1) that should change the status from either Fail to Pass and not by selecting the values in the Recipe (DataCardValue3_1) datacard

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Virikefe22 

    Yes, that is what the formula I provided you does.

    And it IS the selection of the recipe that determines the upper and lower values.  That is all what the formula does.

  • Verified answer
    Virikefe22 Profile Picture
    302 on at

    Thanks @RandyHayes but as soon as I selected any of the Recipe, the values of the Status changed immediately without entering any values into the BD textbox. It is actually when I enter the value into the BD that the Status ought to change.

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 Apps

#1
11manish Profile Picture

11manish 232 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 202 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 122

Last 30 days Overall leaderboard