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
Community Champion
Community Champion

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
Community Champion
Community Champion

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

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

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