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 / Display one to many re...
Power Apps
Answered

Display one to many relationship in Canvas Apps

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I am just a beginner user, but decided to build a test app to explore the capabilites of CDS and Powerapps. I build two tables in CDS with a one to many relationship "Test Company" (Company Name) One>>>Many "Test Sales" (Company Name)... See attached:

 

CDS Test Company RelationshipCDS Test Company RelationshipCDS Test Company EntityCDS Test Company EntityCDS Test Sales EntityCDS Test Sales Entity

So with all this defined I though would a create a simple canvas app with two galleries. One for "Test Company" and one for "Test Sales" and the idea would be to click on "Test Company" gallery and filter "Test Sales" gallery. However the "Company Name" in "Test Sales" does not appear to be visible. Any ideas as why this is???

 

CDS PoweraApp Form.jpg

Categories:
I have the same question (0)
  • mdevaney Profile Picture
    29,991 Moderator on at

    @Anonymous 

    I am not an expert on CDS but I have two ideas:

    • Can you please share what error message you are receiving?
    • CompanyName appears to be a LookUp column.  Type 'Company Name'. with the period and tell us what autocomplete options come up.
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks mdevanev,

    This works if typed into the items section of Test Sales Gallery....

    Filter('Test Sales','Company Name'.'Company Name'=Gallery1.Selected.'Company Name')

     

    For the life of me I am not understanding why it works, but it works.

     

    Jason

  • Verified answer
    mcolbert Profile Picture
    126 on at

    @Anonymous 

     

    When using related entities in CDS, you can filter by referencing the unique identifier (GUID) that CDS creates for each row.  On the many side (Test Sales) there will be a reference to the parent entity (Test Company). 

     

    Look at your entity fields and look for the field with the data type of Unique Identifier,. In your example, you likely have a filed called Test Company, that is of type Unique Identifier, named crdf5_testcompanyid. This is referenceable in the filter on Test Sales based on the relationship you created.

     

    Using the display name for the fields your filter would look like ...

     

    Filter('Test Sales', 'Test Company'.'Test Company' = Gallery1.Selected.'Test Company')

     

    Using the field name your filter would look like ...

     

    Filter('Test Sales', 'Test Company'.crdf5_testcompanyid = Gallery1.Selected.crdf5_testcompanyid)

     

    Hope this helps!

  • mdevaney Profile Picture
    29,991 Moderator on at

    @Anonymous 

    In response to your question it is because LookUp is a complex column type.  This means the field stores several key-value pairs.  For example, a single entry within your Company Name column would look something like this.

     

    {
     ID: 4560-AS02-F03A-B930,
     'Company Name': "ABC Company",
     Field1, "some text data"
     Field2, 12345
    }

    To access data within the LookUp column we reference the column name followed by the key name

     

    'Company Name'.Field1

    This would return the value

     

    "some text data"

    If we've solved the problem here please close the thread to let us know.

     

    ---
    Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly. If your thought the post was helpful please give it a "Thumbs Up."

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks mdevaney,

    You have no idea how many other problems (questions) that answered.

     

    Regards

  • Gyllentid Profile Picture
    894 on at

    I have attempted to do this too andI receive error:

     

    In the Items of Gallery2 I placed :

    Filter(Candidates,'Course schedule'.courseschedulid = BrowseGalleryCourses.Selected.coursescheduleid)

     

    The identifier isn't recognized (the first courseschedulid). These two tables have a many-to-one relationship. Many candidates can be booked to one Course, the lookup column is on the Candidates table:

    Skärmavbild 2021-11-19 kl. 16.59.05.png

    Skärmavbild 2021-11-19 kl. 16.59.39.png

    Is there something backwards with this? I attempted to make this so that the same person could not be related to more than one course. I am not understanding what I am referencing wrong unless there is something I am missing.

     

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
11manish Profile Picture

11manish 536

#2
WarrenBelz Profile Picture

WarrenBelz 426 Most Valuable Professional

#3
Haque Profile Picture

Haque 305

Last 30 days Overall leaderboard