Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Microsoft Dataverse
Unanswered

Creating a CDS view for a Power Apps gallery

(0) ShareShare
ReportReport
Posted on by 664

I have a gallery in Power Apps that is combining data from three separate entities:

  • Customer
  • Customer Details, contains lookup field to Customer. Customer to Customer Details is 1:1
  • Orders, contains lookup field to Customer. Customer to Orders is 1:N

The gallery should show a field from Customers, a field from Customer Details, and the date of the last order they placed from orders. I have accomplished this in my app using AddColumns in the Items property but it is very slow. I used AddColumns instead of looking up the values on the label because I need to sort on the values from Customer Details and Orders.

Is it possible to create a view between these 3 tables? I have only been able to get one on Customer Details and add a field from Customer. Is there something like Join in CDS where I can create the view and pull that into the app instead?

Categories:
  • Cooper01 Profile Picture
    664 on at
    Re: Creating a CDS view for a Power Apps gallery

    The statement is consistent with my testing via the monitor tool. Thanks for the link as well, I like that solution too but I have more than 2000 records in my table and based on my understanding that is the max number of records which can be added.

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at
    Re: Creating a CDS view for a Power Apps gallery

    @Cooper01 

    You can test it to see.  Another alternative to providing increasing performance is to cache the lookup tables by running a collection on them either at the OnStart of the app or in the OnVisible property of the screen containing the gallery.  One of my heros @Meneghino  describes this in his blog https://baizini-it.com/blog/index.php/2018/01/11/powerapps-caching-lookup-tables-to-improve-performance/ 

  • Cooper01 Profile Picture
    664 on at
    Re: Creating a CDS view for a Power Apps gallery

    In this link I am seeing the following: "When you place a LookUp function on a Label inside of the Gallery, then that LookUp will be performed once for every record in the Gallery. That means if you have 100 records in the Gallery the app has to perform 100 individual LookUp calls to the data source to render."

    Is this out of date?

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at
    Re: Creating a CDS view for a Power Apps gallery

    @Cooper01 

    It's not the lookup that adds the lag, it's the AddColumns() because this function is not delegatable.  A lookup does the searching at the server level. 

  • Cooper01 Profile Picture
    664 on at
    Re: Creating a CDS view for a Power Apps gallery

    Thanks for the response. I had a LookUp in my AddColumns function and from my understanding, the app will make the lookup call for each row in the gallery which I am trying to avoid because of the hit to pefromance.  It sounds like building a view of this complexity is not possible.

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at
    Re: Creating a CDS view for a Power Apps gallery

    Hi @Cooper01 

    Sort the view Descending and do a lookup in the canvas app and it will find the last record since Lookup() finds the first matching record but if it is presorted descending, it will actually find the last one.  This technique will avoid possible delegation issues.  

  • Cooper01 Profile Picture
    664 on at
    Re: Creating a CDS view for a Power Apps gallery

    How would you go about configuring logic to only add certain rows to the view (i.e. the last order placed)?

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at
    Re: Creating a CDS view for a Power Apps gallery

    Hi @Cooper01 

    You should be able to add columns from related entities to a view. Annotation 2020-06-26 142640.png

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Microsoft Dataverse

#1
stampcoin Profile Picture

stampcoin 17

#2
ankit_singhal Profile Picture

ankit_singhal 11 Super User 2025 Season 1

#3
mmbr1606 Profile Picture

mmbr1606 9 Super User 2025 Season 1

Overall leaderboard

Featured topics