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 / highlighting dupes in ...
Power Apps
Answered

highlighting dupes in gallery -delegation warning

(0) ShareShare
ReportReport
Posted on by 1,257 Super User 2024 Season 1

I'm using the following to highlight dupes in a gallery based on 2 pieces of info it works fine but I'm getting a delegation warning.  Anyway to alleviate that?

If(
 CountRows(
 Filter('MyDataSource', Year = ThisItem.LYear && MyPerson.Email = ThisItem.MyPerson.Email)
 ) > 1,
 true
 ,false
)

TIA

Categories:
  • Verified answer
    wolenberg_ Profile Picture
    1,476 Super User 2026 Season 1 on at

    The problem it is inside the CountRows Function, this is not delegable

    my recomedation it is store this filtered in a separeted collection, and after do this, you can use the CountRows function inside the collection, something like this:

    ClearCollect(colTemp,Filter('MyDataSource', Year = ThisItem.LYear && MyPerson.Email = ThisItem.MyPerson.Email));
    
    If(
     CountRows(
     colTemp
     ) > 1,
     true
     ,false
    )

     

    -------------------------------------------------------------------

    If my reply helped you, please give a 👍
    If it solved your issue, please give a 👍 & accept it as the Solution to help other community members find it.

  • vffdd Profile Picture
    1,257 Super User 2024 Season 1 on at

    Perfect @wolenberg_  Thank youi

  • vffdd Profile Picture
    1,257 Super User 2024 Season 1 on at

    Thanks @wolenberg_ I spoke too soon ! 🙂 I can see how that would work in some situations however mine is a view gallery so there is no action to do the clear collect and if I do it outside of the gallery then obviously the .thisitem or .thisrecord isn't valid

     

    Any suggestions on how I might get around that?

  • wolenberg_ Profile Picture
    1,476 Super User 2026 Season 1 on at

    In this case @vffdd  , you can use ForAll(GalleryItens) , Collect(Filter) .... doing this you can use ThisRecord.Field to filter inside the ForAll Function, and this can solve the situation for delegation for you.

  • vffdd Profile Picture
    1,257 Super User 2024 Season 1 on at

    Great 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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 243 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 204 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 122

Last 30 days Overall leaderboard