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

CountRows(), IsBlank(), IsEmpty() in Combobox not working properly

I'm using a 3 Comboboxes top of a page and trying to show a gallery filter based on selected value of combobox. 

 

At initial load of the screen, the gallery should show all of the items available in the datasource(SQL). So I'm using this condition.

 

 

 

CountRows(Combobox1.SelectedItems)=0 

 

 

 

 When the screen loads for the first time, this condition is not working at all, it is giving null. So I thought of using IsBlank or IsEmpty function for the same Combobox selected items property. But IsBlank and IsEmpty are workly perfectly for initial load but not working if we clear the Combobox back to no.

 

Can anyone suggest ? 

3 REPLIES 3
mdevaney
Super User III
Super User III

@balaji 
Where exactly are you using this code?  Inside what control?  In which property?

balaji
Frequent Visitor

@mdevaney 

 

This is used in Gallery items. for ex: Gallery Items is 

 

If(CountRows(combobox.SelectedItems)=0,'datasource1',
CountRows(combobox1.SelectedItems)=0,'datasource2')

 

But my actual combo box is 3.

Hi @balaji :

I've made a test:

When the comboxbox control is empty——

  • The value of ComboBox.SelectedItems is a table, even if there is no record in it, powerapp does not seem to think it is a Blank() value.
  • ComboBox.Selected can be Blank().

Therefore, I suggest you try this formula:

 

IsBlank(ComboBox.Selected)

 

Best Regards,

Bof

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

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