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 / Add the choice field t...
Power Apps
Answered

Add the choice field to dropdown on condition

(0) ShareShare
ReportReport
Posted on by 44

Hello,

My aim is to add the 'Rejected' option to the dropdown only if all above dropdowns have a value selected.

If some dropdowns do not have a value selected, the 'Rejected' option should be invisible.

 

Is there a way to do it? Any help would be greatly appreciated!

 

Please see below screenshots for reference:

dbbbb_2-1688115924078.png

dbbbb_3-1688115949714.png

 

Categories:
I have the same question (0)
  • Ethan_009 Profile Picture
    4,838 Moderator on at

    Hi @dbbbb ,

     

    Try the following code, ensure you replace things with your column and control names:

    //This will be in "items" property for Dropdown where Rejected should be invisible
    With(
     {
     EmptyDropdownValidation: (IsBlank(Dropdown1.Selected) && IsBlank(Dropdown2.Selected) && IsBlank(Dropdown3.Selected))
     },
     If(
     EmptyDropdownValidation,
     //Insert your choices, and add this code
     Filter(
     Choices() , !('fieldName' = "Rejected")
     ),
     //All Visible
     Choices()
     )
    )

     

    Hope this helps

  • dbbbb Profile Picture
    44 on at

     

    With(
     {
     EmptyDropdownValidation: (IsBlank(Combobox1) && IsBlank(Combobox2) && IsBlank(Combobox3) && IsBlank(Combobox4))
     },
     If(
     EmptyDropdownValidation,
     Choices('MyList'[@'Status']),
     Filter(
     Choices('MyList'[@'Status']), !(Dropdown_Status = 'Rejected')
     ,
     Choices('MyList'[@'Status'])
     )
     )
     

     

    Hi @Ethan_R, thanks for replying

     

    I tried your code and get an error for !(Dropdown_Status.Selected = "Rejected") : These types cannot be compared: Record, Text

     

    And for the last Choices('MyList'[@'Status'] I get an error: we expect a boolean at this point in the formula

     

     

  • Ethan_009 Profile Picture
    4,838 Moderator on at

    Hi @dbbbb ,

     

    Try the following code:

    With(
     {
     EmptyDropdownValidation: (
     (IsBlank(Combobox1.Selected) || IsEmpty(Combobox1.SelectedItems)) && 
     (IsBlank(Combobox2.Selected) || IsEmpty(Combobox2.SelectedItems)) &&
     (IsBlank(Combobox3.Selected) || IsEmpty(Combobox3.SelectedItems)) &&
     (IsBlank(Combobox4.Selected) || IsEmpty(Combobox4.SelectedItems))
     )
     },
     If(
     EmptyDropdownValidation,
     Choices('MyList'[@'Status']),
     Filter(
     Choices('MyList'[@'Status']), !(Status = 'Rejected')
     )
     ,
     Choices('MyList'[@'Status'])
     )
    )

     

    Note: Status = 'Rejected', here Status is considered the field name. 

    If Status doesn't work, try "Value = "Rejected""

     

    Hope this helps

  • dbbbb Profile Picture
    44 on at

    Hi @Ethan_R, we are very close.

    The code does not produce any errors after altering the code to: !(Status.Text = "Rejected")

     

    However, when I enter the last 

     Choices('MyList'[@'Status'])

      The whole If throws an error: The function 'If' has some invalid arguments

     

    Do you have any clue what might cause this to happen?

  • Verified answer
    Ethan_009 Profile Picture
    4,838 Moderator on at

    Hi @dbbbb ,

     

    There's a small mistake as I copied you code.

    Here's the updated one:

     

    With(
     {
     EmptyDropdownValidation: (
     (IsBlank(Combobox1.Selected) || IsEmpty(Combobox1.SelectedItems)) && 
     (IsBlank(Combobox2.Selected) || IsEmpty(Combobox2.SelectedItems)) &&
     (IsBlank(Combobox3.Selected) || IsEmpty(Combobox3.SelectedItems)) &&
     (IsBlank(Combobox4.Selected) || IsEmpty(Combobox4.SelectedItems))
     )
     },
     If(
     EmptyDropdownValidation,
     Filter(
     Choices('MyList'[@'Status']), !(Status.Text = 'Rejected')
     )
     ,
     Choices('MyList'[@'Status'])
     )
    )

     

     

    Hope this helps

  • dbbbb Profile Picture
    44 on at

    Hi @Ethan_R, the code finally doesn't throw any errors. However, it does not work as expected. After leaving two ComboBoxes blank, I still can choose 'Rejected' in the DropDown. Please see below:

    dbbbb_0-1688127545852.png

     

  • Verified answer
    Ethan_009 Profile Picture
    4,838 Moderator on at

    Hi @dbbbb ,

     

    Please change this condition in above statements as 

     

     

    (
     IsBlank(Combobox1.Selected) || IsEmpty(Combobox1.SelectedItems) ||
     IsBlank(Combobox2.Selected) || IsEmpty(Combobox2.SelectedItems) ||
     IsBlank(Combobox3.Selected) || IsEmpty(Combobox3.SelectedItems) ||
     IsBlank(Combobox4.Selected) || IsEmpty(Combobox4.SelectedItems)
    )

     

     

     

    Let me know if this works?

    As its only about this logic, I hope the conditions are met properly.

     

     

  • dbbbb Profile Picture
    44 on at

    Hi @Ethan_R, the above did not resolve the issue. However, after changing

    !(Status.Text = "Rejected") to !(Value = "Rejected"), the code started to work properly!

     

    A final question from my side: why in the EmptyDropdownValidation you check for IsBlank OR IsEmpty? Isn't IsBlank enough?

    IsBlank(Combobox1.Selected) || IsEmpty(Combobox1.SelectedItems)

     

  • Ethan_009 Profile Picture
    4,838 Moderator on at

    Hi @dbbbb ,

     

    It works, 

    Just from personal experience I use both of them.

     

    You can use "IsEmpty(ComboBox1.SelectedItems)" 🙂

  • dbbbb Profile Picture
    44 on at

    Brilliant, thank you very much for the support @Ethan_R You saved my day!

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 427 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