web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : cLuCkK/vCCjPsljxWCoqNi
Power Apps - Building Power Apps
Answered

Display many to one relationship in Model Driven App grid view (filter the Many to one)

Like (0) ShareShare
ReportReport
Posted on 10 Aug 2023 23:29:12 by 10

Suppose I have a table of customers and a table of purchases. Each purchase belongs to one customer. I want to display a grid view of all customers along with their last purchase. How is that done in a Model Driven App? Can I bring in the last purchase with a formula column?  or should I use Power BI? Or should I use Dataflow to join these tables?! But Dataflow is limited to a 30-minute update.

 

Please use these table/column names in your answer:

customer: id, name
purchase: id, customer_id, item_id, date


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

 

Similar to the above question. How do I make a form of the customer table it should include only the last purchase in the subgrid component?

Categories:
  • Verified answer
    SBax Profile Picture
    1,348 on 14 Aug 2023 at 20:07:45
    Re: Display many to one relationship in Model Driven App grid view (filter the Many to one)

    You could use a canvas app, combine filter and first functions to accomplish this.

     

    You could even use the creator kit "details list" component to display a list of customers, use add columns to create your last purchase alongside any other columns, and configure the list to navigate to the main form if required.

     

    I would say this is your best option if you want a list, and don't want to use flow or JS

  • PowerAppsCom1 Profile Picture
    10 on 14 Aug 2023 at 19:31:46
    Re: Display many to one relationship in Model Driven App grid view (filter the Many to one)

    Thank you for your reply.

    I don't want to go with the Power Automate and JavaScript solution since they might trough errors and I will also have duplicate data. I wonder how come this is not a build feature in Power Apps. This is probably a broad-looked feature. The example above is just 1 of the many N:1 relationship grid views I'm looking for. How can you analyze your data without this view? 

    How will I go when I want to check customers who didn't purchase anything in the last year or customers with total sales greater than a certain amount?

    The same need can be with a School with a list of students and multiple tests and gradings 

    How can they analyze who completes the tests and so on?  

     

    The concept I look for is to have a grid of 1 row per customer/student etc. and pull into the view certain subtables so we can find things without opening each customer/student etc. record. 

    It is quite interesting that in Excel you can do all kinds of lookups and here you are so limited.

    Do you know if, with the Canvas app, we can do this kind of grid?
    Or maybe I should look into the Reports feature?

  • Verified answer
    narayan225 Profile Picture
    2,513 Super User 2025 Season 2 on 14 Aug 2023 at 03:58:26
    Re: Display many to one relationship in Model Driven App grid view (filter the Many to one)

    @PowerAppsCom1 

     

    If you are creating a view, you can create a view from the Purchase table to list the associated customer and sort it by created.

     

    If you need it from customer, you can create a lookup to the last purchase. You can use a flow to pupulate that column whenever the new order is created.

     

    This should allow you to create your view and add to your form.

     

    Cheers!

  • SBax Profile Picture
    1,348 on 12 Aug 2023 at 23:05:07
    Re: Display many to one relationship in Model Driven App grid view (filter the Many to one)

    What sort of volume of purchases are you expecting?

     

    If volumes are relatively low, you could use power automate to write the details of a purchase to the customer table each time a purchase is made.

     

    There is also the option of doing the same using JavaScript calling in the onSave event of the purchase

     

    Happy to help either option if you think one would be suitable? 

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410 Super User 2025 Season 2

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2

Loading complete