cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Testing a column in collection has data

Hello PowerApps,

 

This Code: IsEmpty(Filter(DataViewer, 'Column' = Blank() || 'Column' = "0")) is not working. It does not correclty tell me if there is something in the collection. It shows ture for all occasions.

 

Does anyone have a better solution to test if a column is blank or not or has any fixs.

 

 

Thanks,

AskingQuestions

2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User
Super User

Re: Testing a column in collection has data

@AskingQuestions 

Sorry, had that a little backwards...

In re-reading, you want to determine if the column is blank or is a 0 and thus you consider the colun to be empty.  If that assumption is correct then what you want is:

CountRows(
   Filter(DataViewer, !(IsBlank('Column') || 'Column' = "0"))
   )

Using that formula, if the count is 0, then the column is empty or "0", if it is 1 or more, then there is something besides a blank or a "0".

 

I hope that is clearer.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

Super User
Super User

Re: Testing a column in collection has data

@AskingQuestions 

Yes, as the formula reads - if NOT 'Column' is blank or is "0" then it will match the filter and thus count as a row.  If all are blank or "0" then the filter results will have no records and thus the countrows will be 0.

If any count other than 0 comes back, then some row had something other than a blank or a "0" - and thus had data.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

6 REPLIES 6
Super User
Super User

Re: Testing a column in collection has data

@AskingQuestions 

Consider changing your formula to the following:

CountRows(Filter(DataViewer, 'Column' = Blank() || 'Column' = "0"))=0

The above will be true if the columns are all blank or 0 and false if there is data in them.

 

I hope that is helpful for you.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

Re: Testing a column in collection has data

@RandyHayes ,

 

The My powerapps never returns false for any columns that do have values.

Super User
Super User

Re: Testing a column in collection has data

@AskingQuestions 

Sorry, had that a little backwards...

In re-reading, you want to determine if the column is blank or is a 0 and thus you consider the colun to be empty.  If that assumption is correct then what you want is:

CountRows(
   Filter(DataViewer, !(IsBlank('Column') || 'Column' = "0"))
   )

Using that formula, if the count is 0, then the column is empty or "0", if it is 1 or more, then there is something besides a blank or a "0".

 

I hope that is clearer.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

Re: Testing a column in collection has data

Thanks @RandyHayes ,

 

The Formula seems to be working.

 

Just to be in the same page. This formula filters out the blanks and zeros in a column then counts the rows present in the column. if the result of the formula is zero then that means the column is empty. If the result is greater than zero then that mean there is something in that column.

 

 

Thanks,

AskingQuestions

 

Super User
Super User

Re: Testing a column in collection has data

@AskingQuestions 

Yes, as the formula reads - if NOT 'Column' is blank or is "0" then it will match the filter and thus count as a row.  If all are blank or "0" then the filter results will have no records and thus the countrows will be 0.

If any count other than 0 comes back, then some row had something other than a blank or a "0" - and thus had data.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

Highlighted

Re: Testing a column in collection has data

Thank You @RandyHayes for helping me out.

 

 

 

 

Once again Thanks,

AskingQuestions 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (6,384)