Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

Gallery viewing a related table within it (many to many relationship)

(0) ShareShare
ReportReport
Posted on by 892

I have figured out how to show a related record within a gallery. It works when there is one added record in that relationship, however when I have several added records it is not showing.

 

We have educations where several of the teachers participate in. I'd like to list each teacher within the gallery. 

 

Education_slot 1 has 3 Teacher. 

 

So the way I have looked up a related record has been through ThisItem.City.Name. This way I was able to find the related record of city that the table row had been related to. Writing ThisItem.Teacher.Firstname is not working. 

 

The Teacher column is related to the Systemuser table. Many to many relationship.

 

Someone suggested this way of listing all of the elated records but it's not working: 

 

Concat(ThisItem.Teachers.Firstname ; Text(Value); ", ")

 

 

Everything is connected to Dataverse tables. If you know a video to look at or a blog or know the solutions on how to structure the code... let me know!

Categories:
  • Gyllentid Profile Picture
    892 on at
    Re: Gallery viewing a related table within it (many to many relationship)

    Yes, If you see in my example picture, it is the Swedish word "Förnamn" that is used. Unfortunately everything is in Swedish.

    The data structure:

    Here is the Forms where the System users are added to a record:

    Skärmavbild 2021-11-16 kl. 08.32.53.png

    Here is the relationship between the table Course schedule and SystemUser. It's the many to many that is used, if it's better to create a Many-to-One relationship, I can do so. Many teachers should be able to be added to many courses.

    Skärmavbild 2021-11-16 kl. 08.38.27.png

    Here I am able to get the related SystemUsers in a separate gallery, the referenced relationship is the many-to-many relationship. 

    Skärmavbild 2021-11-16 kl. 08.49.43.png

    Hope this helps!

  • CNT Profile Picture
    10,919 Super User 2025 Season 1 on at
    Re: Gallery viewing a related table within it (many to many relationship)

    @shavora In your main Table, if you have a field called Teachers a Lookup to the systemuser table,  it can't be a M-to-M relationship because for M-to-M relationships you do not need a separate column. Dataverse maintains these relationships though an invisible junction table. So, I believe it is a 1:N relationship. Also in the Systemuser table there is no field called Firstname but rather 'First Name' as you can see below,

    CNT_0-1637006784340.png

     

    Would you mind sharing your data structure for me to help you better.

  • Gyllentid Profile Picture
    892 on at
    Re: Gallery viewing a related table within it (many to many relationship)

    Thanks CNT, I tried it but it gives invalid argument: Skärmavbild 2021-11-15 kl. 14.27.30.png

  • CNT Profile Picture
    10,919 Super User 2025 Season 1 on at
    Re: Gallery viewing a related table within it (many to many relationship)

    @shavora Try this,

    Concat(ThisItem.Teachers; Text(Firstname); ", ")

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 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,660 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,999 Most Valuable Professional

Leaderboard