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 / CDS Canvas App- Galler...
Power Apps
Answered

CDS Canvas App- Gallery Loads Slowly when Filtered by Current User

(0) ShareShare
ReportReport
Posted on by 38

My canvas app takes a long time, sometimes as much as a minute to load a gallery connected to CDS when it is filtered by the current user. 

 

I want it to display a list of open opportunities where the owner is filtered by the current user. Essentially the My Open Opportunities view. I know I can do this using experimental functionality by selecting the view but I need to use this in production.

 

The gallery is made up of the following collection created on the screen IsVisible property - 

ClearCollect(
 openOpportunities,
 Filter(
 Opportunities,
 Status = 'Status (Opportunities)'.Open
 )
);

This contains approximately 160 records.

 

The items property of my gallery is defined as - 

SortByColumns(
 Filter(
 openOpportunities,
 AsType(
 Owner,
 Users
 ).'Full Name' = CurrentUser.FullName
 ),
 "name"
)

The gallery eventually displays items when the app is launched but it takes a long time.

 

Is there a better way of doing this so as to speed things up?

Categories:
  • Verified answer
    RezaDorrani Profile Picture
    12,145 on at

    Hi @PaddyFreefall ,

     

    To avoid delegation issues and at the same time to avoid creating a collection and then filtering,

     

    On load of app, store User().FullName in a variable and use this variable to get the User entity value for logged in user

     

    Set(userfullname,User().FullName);Set(currentuserOwner,LookUp(Users,'Full Name' = userfullname))

     

    Next create your gallery and set items property as follows


    Filter(
    Opportunities,
    Owner = currentuserOwner && Status = 'Status (Opportunities)'.Open
    )

     

     

    Regards,

    Reza Dorrani

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

  • PaddyFreefall Profile Picture
    38 on at

    Magic!

     

    Thanks for your time and assistance @RezaDorrani . This worked a treat!

  • RezaDorrani Profile Picture
    12,145 on at

    @PaddyFreefall your most welcome

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

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 278 Most Valuable Professional

Last 30 days Overall leaderboard