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 a certain choice se...
Power Apps
Answered

If a certain choice selected from dropdown, show an error message

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi, 

 

I'm trying to find out how to show an error message if a certain choice is selected in a drop down. 

 

I have a dropdown menu in a form where one of the options is '-' and I want to make it so that if anyone selects that option, they are unable to submit the form and an error message comes up saying 'please select another option'. 

 

So far I've tried this:

If(DataCardValue4.Value= "-", Notify("Please Select a Team", Error, 4000), SubmitForm(Form1_1) & Navigate(BrowseScreen1, ScreenTransition.UnCover))
 
but I'm getting an error on the formula. Can anyone help? 
Categories:
I have the same question (0)
  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @BT168 

    You have a text concatenation symbol (&) in your formula.  This will produce an error.

    I am not sure if your logic is to show an error and then navigate to the other screen, but if so, then this should be your formula:

    If(DataCardValue4.Value= "-", 
     Notify("Please Select a Team", Error, 4000), 
     
     SubmitForm(Form1_1);
     Navigate(BrowseScreen1, ScreenTransition.UnCover)
    )

     

    Some recommendations are to put your Navigate function in the OnSuccess action of your Form1_1.  This way the user would only navigate to the screen if the submit is successful.  With your formula, they would navigate regardless of success.

     

    Also, you might consider changing the DisplayMode of your submit button to this instead:

    If(DataCardValue4.Value= "-", Disabled, Edit)

    And your submit OnSelect to :  SubmitForm(Form1_1)

    And again, the Navigate in the OnSuccess.

    This is more "App-like" than popping up error notices.

    Just a suggestion.

     

    I hope this is helpful for you.

  • BT168 Profile Picture
    Microsoft Employee on at

    @RandyHayes 

     

    Ah great recommendations thank you! I'm still relatively new to PowerApps so good to get these tips and tricks. 

     

    However when I put in 

    If(DataCardValue4.Value= "-", Disabled, Edit)

    in the DisplayMode of my submit button, I get an error on the .Value part saying the name isn't valid and the identifier isn't recognised? 

     

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

    @BT168 

    Sorry...typing too quick without the aide of a formula editor syntax checker...

    This should be the formula:

    If(DataCardValue4.Selected.Value= "-", Disabled, Edit)

     

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!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 482 Most Valuable Professional

#2
11manish Profile Picture

11manish 459

#3
Haque Profile Picture

Haque 331

Last 30 days Overall leaderboard