cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

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

@Anonymous 

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

@Anonymous 

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

@Anonymous 

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.
Anonymous
Not applicable

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

@Anonymous 

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

Anonymous
Not applicable

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

@Anonymous 

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

Anonymous
Not applicable

Re: Testing a column in collection has data

Thank You @RandyHayes for helping me out.

 

 

 

 

Once again Thanks,

AskingQuestions 

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (4,724)