web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / First time load - “err...
Power Apps
Answered

First time load - “error - right hand side can’t be null”.

(0) ShareShare
ReportReport
Posted on by

Hi

I am having an issue with a gallery which is a filtered data source. The first time the page loads, I get an error with the right hand side of an operator showing null. I know this is not really an error as when I pre-load the data into a collection, I don’t see the error. It seems that the data can’t load quickly enough. Is there a way to delay it or something?

 

The error is showing on a visible property of a text label which is using a COUNTROWS function checking for different date criteria.

Categories:
  • WiZey Profile Picture
    3,023 Moderator on at

    Hello @jed76 ,

     

    I'm guessing the error trigger because PowerApps is trying something when expecting the collection to hold some records when it's actually empty.

     

    Can you try encasing your function with "IsEmpty()" and see how it goes?

     

    If(IsEmpty(collection),
     //Do nothing,
     //Else do something
    )
  • jed76 Profile Picture
    on at

    Many thanks. My issue is that it works fine when using a collection but I want to filter directly to the data source as they’re could eventually be more than 2000 records. 

  • WiZey Profile Picture
    3,023 Moderator on at

    Working with more than 2000 records means avoiding delegation issues, which can be a bit tricky sometimes.

     

    My advice is to still try and store the whole SharePoint list in a local collection with a delegable "ClearCollect()", and then work with the 2000+ records collection.

     

    To store 2000+ records from a list to a collection, I suggest checking this article:

     

    https://www.matthewdevaney.com/create-power-apps-collections-over-2000-rows-with-these-4-tricks/

     

  • jed76 Profile Picture
    on at

    Thanks. That kind of what I had done but I have managed to filter using all delegable functions. 

  • Verified answer
    timl Profile Picture
    37,287 Super User 2026 Season 2 on at

    Hi @jed76 

    If you try separating the filter expression and CountRows by using 'With', does that make a difference?

    With(
     {varData:Filter(yourDataSource, yourCriteria)},
     //your formula with CountRows(varData)
    )

    You could also wrap this around a call to IfError to suppress the error.

     

    The comment I'd also make is that unless you're using Dataverse, CountRows is not delegable. This is probably the reason why your data is not loading fast enough and resulting in the null exception that you see.

  • jed76 Profile Picture
    on at

    Many thanks! Will give this a go. I was thinking about using IfError too. Thanks.

  • jed76 Profile Picture
    on at

    Wrapped all of the filters around an IfError, and that has done the trick! Many thanks. 

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 402 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 296 Most Valuable Professional

Last 30 days Overall leaderboard