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

Bug in the Filter Function when filtering with IsBlank()???

Completely baffled as to what is causing my Filter() function to return incorrect results

 

# This results in 78

CountRows(Filter(
'Facilities Contacts',
IDSegment = SelectedSegment &&
StatusCode = "ACTIV" &&
(!IsBlank(PagerEmail) || true)
)) 

 

# This results in 55

CountRows(Filter(
'Facilities Contacts',
IDSegment = SelectedSegment &&
StatusCode = "ACTIV" &&
(!IsBlank(PagerEmail) || false)
)) 

 

# For whatever reason, adding !IsBlank() results in 3. 

CountRows(Filter(
'Facilities Contacts',
IDSegment = SelectedSegment &&
StatusCode = "ACTIV" &&
(!IsBlank(PagerEmail) || !IsBlank(Email))
)) 

 

 See attached images! Either something is wrong with my syntax or something very strange is going on.  

 

The same thing happens for the actual rows returned for the data source. I've tried substituting the logical operators with the logical functions--same result. However, when I paste my actual logic into a text field that's evaluated for each record, it prints the what's expected. Any idea what's going on here?

 

 

2 REPLIES 2
Super User III
Super User III

@kingc5 

Firstly I noticed this code has a delegation issue.

CountRows(Filter(
'Facilities Contacts',
IDSegment = SelectedSegment &&
StatusCode = "ACTIV" &&
(!IsBlank(PagerEmail) || true)
)) 

 

How many records are in your SharePoint list.  Have you considered bumping up the delegation limit to 2,000 rows in advanced settings?

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Community Support
Community Support

Hi @kingc5 ,

Could you please share a bit more about the data source used in your formula?

How many records existed in your data source? More than 2000?

 

Based on the screenshot that you mentioned, I found that you have faced a Delegation warning issue with your formula. If the amount of your data source records is more than 2000, the Filter formula you provided could only retrieve first 2000 records at most.

Note: In default, if you have faced a Delegation warning issue in your formula, you could only retrieve first 500 records from your data source. You could change this limit to maximum value -- 2000.

More details about the Delegation issue in PowerApps, please refer to the following article:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/delegation-overview

 

As an alternative solution, you could consider modify your third formula as below:

CountRows(
          Filter(
                 'Facilities Contacts',
                  IDSegment = SelectedSegment,
                  StatusCode = "ACTIV",
                  Not(IsBlank(PagerEmail) && IsBlank(Email))
          )
) 

or

CountRows(
          Filter(
                 'Facilities Contacts',
                  IDSegment = SelectedSegment,
                  StatusCode = "ACTIV",
                  Not(PagerEmail = Blank()) || Not(Email = Blank())
          )
) 

 

Please make sure you have set the "Data row limit for non-delegable queries" option within Advanced settings of App settings of your app to maximum value -- 2000.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Users online (7,257)