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 / Canvas app with CDS Ma...
Power Apps
Answered

Canvas app with CDS Many-to-Many relationship in a Gallery

(0) ShareShare
ReportReport
Posted on by 716

Hello Power Apps Community,

I would like some help please. 

I've created two CDS entities: "Level" and "Measure". It's a "Many-to-Many" relationship.

I have a simple canvas app. 

On screen 1 is a gallery of all the records for "Levels". I have a "Next Arrow" icon against every "Level" record. 

When I select a specific "Level" record, it navigates to screen 2.

On screen 2 I wish to have a gallery of all the "Measure" records for the selected "Level" record.

 

So, my question is how can I show all the "Measure" records for the selected "Level" record?

 

I can't find out how to do this and think it's due to the Many-to-Many relationship. At a One-to-Many relationship I've been able to achieve this by using a filter with different entities.

Any help would be greatly appreciated.

 

Garry

I have the same question (0)
  • EricRegnier Profile Picture
    8,720 Most Valuable Professional on at

    Hi @GarryPope

    I assume you're using the out-of-the-box CDS many to many relationship type? Haven't tried it myself but in your expression, can your try by navigating with the relationship name or relationship entity name? For ex:

    Gallery1.Selected.<relationship name>

    2020-08-04_21-39-28.png

  • CU01081947-0 Profile Picture
    716 on at

    Hello @EricRegnier,

    Thanks so much for the reply. I hope all is well.

    You are correct, I'm using the out-of-the-box relationships for CDS. 

    I tried your suggestion, but wasn't able to get it working, it might be my lack of understanding of canvas app functions/formulas etc. So I've raised a ticket to Microsoft. When I hear back from them, I'll post it here. 

    A question relating to this, do you know of anyone who has a great blog/YouTube channel that focuses on building canvas apps with CDS? If so, if you could provide me with the details that would be great. Now that Data Flex is coming I need to focus on canvas apps more. Haha. 

     

    Like always, thanks for your help,

    Garry 

  • Joel CustomerEffective Profile Picture
    3,224 on at

    Shane Young has several cds canvas app videos

    https://youtu.be/49O1UW-tkyo

  • Verified answer
    CU01081947-0 Profile Picture
    716 on at

    Hello @EricRegnier,

    I spoke with Microsoft, and actually this is really easy to do. Like always, I was making it far too complicated! They pointed me to this Microsoft blog post. It works perfect.

    Thanks for your help.

    Garry

    PS @jlindstrom thanks for the tip!

  • Gyllentid Profile Picture
    894 on at

    Hi GarryPope, What kind of formula did you use? The link was quite vast and I wasn't able to find which one you used.

  • CU01081947-0 Profile Picture
    716 on at

    Hello @shavora,

    Thanks for the message. It's over a year since I last looked at this, so had to remind myself what I was doing. And I've deleted the app I was creating. From the Microsoft post look at where it begins "Many-to-Many Relationships".

     

    I quickly built a basic app and tried it out, and I was able to click on a record in my "Level" table and only see the records associated to it from my "Measures" table in another gallery. See below. 

     

    I created a screen with a gallery and pointed at my Level table.
    It shows all Level records in Dataverse.  

    GarryPope_0-1637008241346.png

     

    For the chevron icon at the end of each record I set the OnSelect property as 
    Select(Parent); Navigate('Screen Measure')

    GarryPope_1-1637008399263.png

     

    When I click the chevron icon I want to be taken to a second screen that shows all the "Measure" records associated with the selected "Level" record.

     

    To do this I created a second screen with a gallery.

    In the gallery's "Items" property I set it to: 
    'Gallery Level'.Selected.Measures

    (If I was going to explain, poorly, the expression above; it is saying for the gallery with all the Level records, for the Level record you selected in that gallery, find all the Measure records related to it... But that might be a completely wrong description of what it is actually doing, but that's how I say it to myself.)

     

    GarryPope_6-1637009512310.png

     

     

    It then shows me only the Measure records associated with that Level record I selected on the previous screen.
    In the screenshots above I selected the "Level 1" record and got two Measure records associated with it "Measure AA" and "Measure BB".

     

    GarryPope_2-1637008511777.png

     

    As another example, look at the below. I select the "Level 2" record.

    GarryPope_4-1637008783032.png


    And now get different Measures, "Measure CC", "Measure DD", "Measure EE".

    GarryPope_5-1637008855239.png

     

    Hope that makes sense?

    Canvas apps are not my speciality unfortunately. I'm sure there is a better more elegant way of doing this.

    Let me know how you get on. Good luck!

  • Gyllentid Profile Picture
    894 on at

    Great walk through, It is so essential with these step by step showcases as a beginner. 🙏

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 762

#2
11manish Profile Picture

11manish 640

#3
Valantis Profile Picture

Valantis 548

Last 30 days Overall leaderboard