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 / If( CountRows( Filter(...
Power Apps
Answered

If( CountRows( Filter( LookUp()))) Deligation Problems

(0) ShareShare
ReportReport
Posted on by 50

I have this line of code, to make an icon visible and not visible. Which should be working properly, I am getting gathering problems from network errors (which I believe is for delegation), I will be having over 2000 rows so I cannot just change from advance settings.


If( CountRows( Filter(Collection, LookUp(Collection, ID = ThisItem.'ID').State = StateChoice.Unattended)) > 0, true, false)

 Is there a way to make it function without these problems?

Thank you

Categories:
  • victorcp Profile Picture
    2,350 Moderator on at

    Hi,

    try this:

     

    With(
     {vFilter:Filter(Collection, LookUp(Collection, ID = ThisItem.'ID').State = StateChoice.Unattended)},
     CountRows(vFilter) > 0
    )

     

    It is not necessary to use 'If(..., true, false)' because the return of 'CountRows(...) > 0' is true or false

     

    I hope it helps 🙂

  • AlvinCassar Profile Picture
    50 on at

    Hi this doesn't work fully, examples below.

    CarColourState
    Toyotablueinprogress
    Toyotaredunattended
    Toyotayellowunattended

     

     

    For the example above it is returning with 0, while it should have 2 and make the visible as true. Also, I am trying to do a column which is either showing 500 for true and 0 for false. Just used the code you submitted before and removed the > 0.

     

    Thanks.

  • victorcp Profile Picture
    2,350 Moderator on at

    Question: Do you want to Filter all the unattended items, right? is there any extra filter?

  • AlvinCassar Profile Picture
    50 on at

    I need to get the count of unattended items, for the example above it would be 2 and the number placed in a label. If there is 1 or more inside which are unattended for a specific car for example an icon would be visible or not. And if possible a collection containing each item which has the same car type and are unattended, which can be used later on.

     

  • victorcp Profile Picture
    2,350 Moderator on at

    I see, so try this:

     

    With(
     {vFilter:Filter(Collection, State = StateChoice.Unattended)},
     CountRows(vFilter) > 0
    )

    and make sure 'StateChoice.Unattended' match the data in 'State' column

     

  • AlvinCassar Profile Picture
    50 on at

    I need to match the Id aswell, for example results of Toyota that are unattended, and results of Audi which are unattended.

  • Verified answer
    AlvinCassar Profile Picture
    50 on at
    With(
     { vFilter: Filter('Vulnerability Tables', 'CVE ID Text' = ThisItem.'CVE ID' && State = StateChoice.Unattended) },
     CountRows(vFilter) > 0
    )

     

    Using this code fixed my problem, essentially combining both filters into 1. 

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 395 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 260 Most Valuable Professional

Last 30 days Overall leaderboard