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

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (47,012)