Welcome to deBUG.to Community where you can ask questions and receive answers from Microsoft MVPs and other experts in our community.
0 like 0 dislike
777 views
in Power Platform by 22 23 29

I'm using the CountRows function in Dataverse, but it's returning 0 rows even though I have data in my table. What could be causing this issue? Has anyone else encountered this problem before?

I am using the below formula to return the count of rows in a dataverse table.

CountRows('Sessions')

1 Answer

1 like 0 dislike
by 163 204 403
selected by
 
Best answer

Why CountRows return 0 Rows in Dataverse?

  1. Ensure that you’re specifying a valid column when using CountRows.
  2. If most of the columns in your ‘Sessions’ table are optional, and you’re getting zero results, it might be because you’re not specifying a mandatory column. In your case,‘Created On or ID seems to work correctly.

      CountRows('Sessions'.'Created On')
    

If the above formula didn't work, try to use one of the below samples:

  1. This formula gives you the total row count for the Sessions table, and TRUE means it selects all rows

     CountRows(Filter('Sessions', true))
    
  2. Or this formula that counts the number of rows in the Sessions table where the FieldName column is not blank

     CountRows(Filter('Sessions', !ISBlank(FieldName)))
    
If you don’t ask, the answer is always NO!
...