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?