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 / Delegation Error in Po...
Power Apps
Unanswered

Delegation Error in Power apps gallery

(0) ShareShare
ReportReport
Posted on by 41

Hi All,

I am using below mentioned formula in gallery to show last visited by column available in SharePoint list, however it is throwing delegation error, can you please help me to eliminate delegation and make it work smoothly?

 

LookUp(
 Visit_Tracker,
 ID = Max(
 Filter(
 Visit_Tracker,
 DID = ThisItem.ID
 ),
 ID
 )
).Visited_By

 

Thanks & Regards,

Sanket 

 

Categories:
  • Rajkumar_M Profile Picture
    3,747 Moderator on at

    Hi @Sanket_Katdare 

     

    Create a Collection: In the app's OnStart property or Screen OnVisible wherever you load your data, create a collection that includes the required columns from the SharePoint list.

     

    ClearCollect(
    VisitTrackerCollection,
    Visit_Tracker
    )

     

    Gallery item:

     

    LookUp(
    VisitTrackerCollection,
    ID = Max(
    Filter(
    VisitTrackerCollection,
    DID = ThisItem.ID
    ),
    ID
    )
    ).Visited_By

     

    This approach pre-loads the data into a collection, allowing you to use non-delegable functions like Max and Filter on the collection instead of the SharePoint list, which should resolve the delegation error.

     

    Thanks!

     

    If my response has been helpful in resolving your issue, I kindly request that you consider clicking "Accept as solution" and "giving it a thumbs up" as a token of appreciation.

  • Sanket_Katdare Profile Picture
    41 on at

    Hi Rajkumar,

     

    As you suggested i have created VisitTrackerCollection, also have loaded it and cheked whether it has any data by using First(VisitTrackerCollection).Visited_By in one of the label it worked fine.

    After that i come back to my gallery and applied   Lookup formula in Lable2 as shown below however it is not returning anything  and showing some error in bottom, sharing screenshot, kindly suggest ... 

     

    Sanket_Katdare_1-1695754446095.png

     

     

  • Rajkumar_M Profile Picture
    3,747 Moderator on at

    Try this formula in label2 property

     

    Text(
    First(
    Filter(
    VisitTrackerCollection,
    DID = ThisItem.ID,
    ID = Max(Filter(VisitTrackerCollection, DID = ThisItem.ID), ID)
    )
    ).Visited_By
    )

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

#2
Mohsin Ali Profile Picture

Mohsin Ali 225

#3
M Bilal Khan Profile Picture

M Bilal Khan 192

Last 30 days Overall leaderboard