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 / Many-to-Many "Table" R...
Power Apps
Answered

Many-to-Many "Table" Referencing?

(1) ShareShare
ReportReport
Posted on by 176
I interpret that Many-to-Many relationships mean that any one record of a table could reference multiple other records of another table, and vice versa. I have two tables, "Assembly - Operators" and "Assembly - Lines" and I've made a small model-driven app to create those relationships between them (operators are assigned to 1-3 lines).
 
I have successfully used lookups (many to one) in Power Apps, where I can reference a single other record from another, and I expected that many to many would be similar, other than that I would instead be referencing a selection of an auto-generated table of records instead of a column I created that contains a single record.
 
I have had some success in extracting the line record from single operator records, in galleries where their Items are set to something like:
 
 
I can even do things like:
 
 
This made me think that 'Assembly - Lines' can be referenced like a column, where it is a table associated with that specific record that hold the related Lines.
 
However, I'm running into a lot more issues when trying to use this in more complex ways, for example when attempting to filter the Operators by if they are related to a Line with the name "Z-MAX":
 
This seems counter-intuitive to what I am able to do with 'Assembly - Lines' in other contexts. Is there a better way to accomplish this?
I have the same question (0)
  • Gil0 Profile Picture
    128 on at
    Hello,
     
    Using the 'in' operator within the filter function typically pulls matching results from Many-to-Many relationships.
     
    Filter(
        'Assembly - Operators',
        "Z-MAX" in 'Assembly - Lines'.Name
    )
     
    If my response helped figure out the issue, please mark as resolved so it helps direct others.
  • BenKraft Profile Picture
    176 on at
    Hi @Gil0,
     
    Thanks for the help! Funnily enough, this is what I tried first. Delegation issues are something I try to avoid, so I've gotten into the habit of using the !IsBlank(LookUp([...])) convention. Unfortunately, I get the same error with this syntax:
     
  • Gil0 Profile Picture
    128 on at
    No problem! Good thinking on delegation issues. 
     
    I just noticed that LookUp is being used with ThisRecord as the reference, which pulls a single row. LookUp requires a table reference. Since an operator is related to 1-3 line items, try this instead:

    Filter(
        [@'Assembly - Operators'],
        'Assembly - Lines'.Name = "Z-MAX"
    )
     
    It should return a table filtered with only the records related to Z-MAX.
     
    A dynamic approach, depending on what you're trying to accomplish with this function, would be:
     
    Filter(
        [@'Assembly - Operators'],
        'Assembly - Lines'.Name = ThisRecord.Name
    )
     
    Hope this helps!
  • BenKraft Profile Picture
    176 on at
     
    @Gil0 I'm not sure if I follow. When would 'Assembly - Lines'.Name ever be equal to a string? Would it not, at the least, be an isolated Name column from the sub-grid 'Assembly - Lines' table from a single record of 'Assembly - Operators'?
     
    In your second snippet, would ThisRecord not refer back to the Operator? I want the Line name tested for to be literal.
  • Ram Prakash Duraisamy Profile Picture
    5,877 Super User 2026 Season 1 on at
    Hi @BenKraft

    Can you give a try for below Code
     
    With(
      {
        LineOperators:
          Filter(
            'TableName',
            'Assembly - Lines'.Name = "Z-MAX"
          ).'Assembly - Operators'
      },
      Filter(
        'Assembly - Operators',
        OperatorId in LineOperators
      )
    )
    
    Please mark as answer if my suggestion helps.
    Subscribe here for More Useful videos : https://www.youtube.com/@rampprakash3991

     
  • BenKraft Profile Picture
    176 on at
    @Ram Prakash Duraisamy Thanks for the help,
     
    I'm curious on some of the details on your provided snippet. What does/should 'TableName' reference? This feels like it filters the Operators twice. If 
    Filter(
        'Assembly - Operators',
        'Assembly - Lines'.Name = "Z-MAX"
    )
    doesn't work by itself, I'm not sure how it would function within a With() statement.
  • BenKraft Profile Picture
    176 on at
    I've continued trying different methods; Is it really not possible to filter a table by properties of its records' relationships? Why am I able to access these related records for a single record individually but not within functions?
  • Gil0 Profile Picture
    128 on at
    Hello,
     
    It should be possible to access another table's values based on the relationship from a different table. Also, I realize that I made a syntax error in my latest response.
     
    This is what my actual approach would be:
     
    Filter(
        [@'Assembly - Operators'],
        ThisRecord.'Assembly - Lines'.Name = "Z-MAX"
    )
    
    
    The ThisRecord.'Assembly - Lines' portion should provide access to the 'Assembly - Lines' table properties as it represents the GUID, then .Name should further return the exact matching string values that contain "Z-MAX."
     
     
  • BenKraft Profile Picture
    176 on at
    @Gil0 Unfortunately, the field is still not accessible:
     
     
     
    However, even if the column was accessible, I'm not confident that snippet wouldn't result in another error; since the relationship is many-to-many, ThisRecord.'Assembly - Lines' references multiple records (in what I assume would be a table format), so using the dot accessor would result in a single-column table, which cannot be compared to a single string using "=".
     
    I want to also provide proof that the relationship exists since I realize I did not before:
     
    Thanks again for the help!
  • Ram Prakash Duraisamy Profile Picture
    5,877 Super User 2026 Season 1 on at
     
    Yes first am filtering the record from the table and showing those records with another filter.
     
    Please mark as answer if my suggestion helps.
    Subscribe here for More Useful videos : https://www.youtube.com/@rampprakash3991

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 424

#2
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#3
11manish Profile Picture

11manish 290

Last 30 days Overall leaderboard