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 / When option selected f...
Power Apps
Unanswered

When option selected from dropdown - Textbox MUST have value exceeding 0

(0) ShareShare
ReportReport
Posted on by 10

Hello, I’m very new to Powerapps.

I was wondering if someone could please help me with how I would be able to do this!

I need to make it so that when “YES” is selected in the drop-down option for “BOBS”, that the “No. Individuals field must have a value equal to 1 OR more. If value was under 1, display an error message that states “Error – Value must exceed 0”

The BOBS dropdown has been created in excel as a simple column 2 option table.

For this example in the code, please refer to the dropdown as ‘BOBSyesno’ and No.Individuals as ‘No.Individuals’.

I have attached a PDF displaying the screen.

Thankyou!

Categories:
I have the same question (0)
  • v-mengmli-msft Profile Picture
    Microsoft Employee on at

    Hi @cameron12 ,

     

    Please try this:

    OnSelect of drop down:

    If(DropdownName.Selected.Value/ColumnName="YES"&&Value(TextInputName.Text)<1,Notify("Value must exceed 0 in NO.Individuals field"))

     

    Best regards,

    Rimmon

     

     

  • cameron12 Profile Picture
    10 on at

    Hi Rimmon, thanks for your reply. I tried the code and it won't let me do the Selected.Value part, it will only let me say Selected.Coloumn1 for it to not be an error. Is this to do with how the EXCEL is set up?

     

    when i did the coloum1 part, the code doesn't have an error however, when i enter 0 in the field and move on there is no error message appearing.

     

    thanks

     

    If(Bobyesno.Selected.Column1="YES"&&Value(Numberofindividualstext.Text)<1,Error("Value must exceed 0 in No. Individuals field"))

     

  • v-mengmli-msft Profile Picture
    Microsoft Employee on at

    Hi,

    The items of my dropdown is a table which has a column named "Value", this is why I used "Value" in the code. Replacing it with your column name works just as well.

     

    Best regards,

    Rimmon

  • cameron12 Profile Picture
    10 on at

    Thanks Rimmon, 

     

    Doest seem to want to work for me unfortunately, there is no error message or box highlighted etc. Could this be because I haven't set up the submission button or are they all independent? 

    or

    Is it something to do with my excel table? perhaps you could show me a screenshot of what yours looks like? I've tried going with both options in 1 column and both options over 2 columns. 

     

    thankyou very much!

  • v-mengmli-msft Profile Picture
    Microsoft Employee on at

    Sure.

    I modified my code.

    This is my test:

    vmengmlimsft_0-1700808893607.png

    vmengmlimsft_3-1700810084793.png

    When I select "YES", there will be a notify.

    vmengmlimsft_4-1700810126681.png

    Or you can put this code on the OnChange property of the TextInput.

    If(Bobyesno.Selected.Column1="YES"&&Value(Numberofindividualstext.Text)<1,Notify("Value must exceed 0 in No. Individuals field"))

    vmengmlimsft_5-1700810181177.png

     

    Rimmon

  • cameron12 Profile Picture
    10 on at

    Awesome! that worked! thankyou, is there any way to either make the alert in the middle of the screen or for the text box to have a red * representing the error?

  • v-mengmli-msft Profile Picture
    Microsoft Employee on at

    Please modify the code as:

    If(Bobyesno.Selected.Column1="YES"&&Value(Numberofindividualstext.Text)<1,Notify("Value must exceed 0 in No. Individuals field")&&Set(var,Color.Red),Set(var,Color.AliceBlue))

    vmengmlimsft_0-1700817661240.pngvmengmlimsft_1-1700817680298.png

     

    If my answer help solve your problem, please accept it as a solution.

    Thanks!😀

    Rimmon

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 401 Most Valuable Professional

#2
11manish Profile Picture

11manish 201 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard