cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MaxF
Frequent Visitor

Combobox is empty check not working

Hello,

 

In my scenario I have several comboboxes that should be checked on save if they contain an entry or are they empty. If they are empty an error message should be thrown. But the problem is now, only when I have selected an item and then removed it again the checks work. If nothing is selected before, the check does not work. In addition I have set for DefaultselectedItems = Blank()

 

What I have tried:

If(isEmpty(combobox.selecteditems) or If(isEmpty(combobox.selecteditems.Value)

If(isBlank(combobox.Searchtext)

combobox.selecteditems = Blank() or combobox.selecteditems.Value = Blank()

CountRows(combobox.Selecteditems.value) = 0

 

1 ACCEPTED SOLUTION

Accepted Solutions
StalinPonnusamy
Super User
Super User

Hi @MaxF 

 

Please try this

 

If(
    IsEmpty(combobox.SelectedItems) || IsBlank(combobox.SelectedItems) || Len(combobox.Selected.Value) <= 0,
    Notify("combobox is empty"),
    SubmitForm(EditForm1) //Do action
)

 

 

View solution in original post

4 REPLIES 4
StalinPonnusamy
Super User
Super User

Hi @MaxF 

 

Please try this

 

If(
    IsEmpty(combobox.SelectedItems) || IsBlank(combobox.SelectedItems) || Len(combobox.Selected.Value) <= 0,
    Notify("combobox is empty"),
    SubmitForm(EditForm1) //Do action
)

 

 

v-qiaqi-msft
Community Support
Community Support

Hi @MaxF,

Do you want to check if there is any selected or search text within the Combo Box?

Could you please tell me more about your scenario?

 

If you want to determine there is nothing selected and nothing searched within Combo Box, you should use the And operator to combine the conditions that check Combo Box selected and Combo Box search text.

Please modify your formula as below:

If(
    (IsEmpty(ComboBox42.SelectedItems) || IsBlank(ComboBox42.Selected.Value)) && IsBlank(ComboBox42.SearchText),
    SubmitForm(EditForm1),
    Notify(
        "Please fill in the Combo Box!",
        Error
    )
)
Best Regards,
Qi
CNT
Super User
Super User

@MaxF Just do CountRows(ComboBox.SelectedItems) as seen below,

Combobox.gif

thanks, I ask me why you have to proof all this things at the same time but I think this has to do with the structure of the combobox.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (2,788)