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 / Combobox - field is re...
Power Apps
Answered

Combobox - field is required or not

(0) ShareShare
ReportReport
Posted on by 69

Hello,

Could someone please help me solve this problem?

I have a combobox called "Reason for request" with 4 selection options.
If someone selects "import" as the reason from the combobox, the "Value" field becomes mandatory. If someone select one of the other three, the "Value" field does not need to be filled in.

BRL7WZ_0-1696281414065.png

I entered the rule in DisplayMode:
If("import";ComboBox.Selected.Value;Disabled)

However, without success.
What am I doing wrong?

Categories:
I have the same question (0)
  • Verified answer
    Ami K Profile Picture
    15,687 Super User 2024 Season 1 on at

    @BRL7WZ - short answer:

     

    I am not clear on what you have in the Items property of that Combo Box, but on the DisplayMode property of the Value field, try:

     

    If(
     ComboBox.Selected.Value = "Import",
     DisplayMode.Edit,
     DisplayMode.Disabled
    )

     

     

    Longer answer. You have many options:

     

    Assuming your using a Form control, you could set the Required property of the DataCard (not the DataCardValue) with a condition. E.g.:

     

    'Your Combobox'.Selected.Value = "import"

     

    Then when the user tries to use the SubmitForm function without a value entered in the "Value" field, an error message will appear inside the DataCard for that field.

     

    In addition, you could apply the below to the OnFailure property of the Form to give the user a clear reason for the failed submission.

     

    Notify(
     "The Value field is mandatory etc",
     NotificationType.Error
    )

     

  • BRL7WZ Profile Picture
    69 on at

    Hi,

    Thank you very much for such a great explanation.
    I entered your suggestion in the Value field and it works perfectly.

    Unfortunately, however, I do not use Form control, I only have DataCardValue in my application.

    Is there any other option in this situation to prevent the app from allowing the user to continue without filling in the "Value" field?

     

  • Verified answer
    Ami K Profile Picture
    15,687 Super User 2024 Season 1 on at

    Preventing the user from proceeding further by disabling the button in my opinion is the best option. From a UI perspective, I think you should also provide the user with visual feedback so it is clear why the button has been disabled.

     

    For example, you could create a Label with the text "Mandatory" and position it next to the Value field, and then apply the below to the Visible property of that Label:

     

    'Your Combobox'.Selected.Value = "Import"

     

     

    You have a Dropdown called "DataCardValue" (which is the default name given to the input controls on Forms), but you do not have a Form?

  • BRL7WZ Profile Picture
    69 on at

    Hello,

    Yes, this is it. Everything works great!

    Thank you very much for help.

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 April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 1,055

#2
Valantis Profile Picture

Valantis 666

#2
11manish Profile Picture

11manish 666

Last 30 days Overall leaderboard