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 / Gallery viewing a rela...
Power Apps
Unanswered

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

(0) ShareShare
ReportReport
Posted on by 894

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:
I have the same question (0)
  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @shavora Try this,

    Concat(ThisItem.Teachers; Text(Firstname); ", ")
  • Gyllentid Profile Picture
    894 on at

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

  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @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
    894 on at

    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!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 364 Most Valuable Professional

#2
11manish Profile Picture

11manish 186

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 105 Super User 2026 Season 1

Last 30 days Overall leaderboard