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 / Relate function not wo...
Power Apps
Unanswered

Relate function not working on many to many

(0) ShareShare
ReportReport
Posted on by 104

Hi everyone,

 

I have a table called "Tasks". It has two many-to-many self-referential relationships:

 

"Dependent"

"Contingent"

 

Why does only one the first of these relate functions work?:

 

 

 

ForAll(
 colNewTasks, // Picked from a gallery of 'Tasks'
 Relate(SelectedTask.'Dependent', ThisRecord); // SelectedTask is a record selected from a gallery of 'Tasks' - this works.
 Relate(ThisRecord.'Contingent', SelectedTask) // This does not work
)

 

 

 

Thanks for any assistance

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

    @JT_Corrin try putting SelectedTask as the first parameter. 

  • JT_Corrin Profile Picture
    104 on at

    Thanks @CNT - the first parameter expects a table and the second a record - so SelectedTask as first parameter throws an error

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

    @JT_Corrin that's not quite true. You relate two records as shown in the following example in the Power Apps documentation,

    Products and Contacts are related through a Many-to-Many relationship. To relate the first record of the Contacts table with the first record of the Products table:

    Relate( First( Products ).Contacts, First( Contacts ) )

    As Many-to-Many relationships are symmetric, we could also have done this in the opposite direction:

    Relate( First( Contacts ).Products, First( Products ) )

  • JT_Corrin Profile Picture
    104 on at

    But you have passed a table first and a record second in both of those examples...

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

    @JT_Corrin First( Products ).Contacts and First( Contacts ).Products return just one record and not a table. Further please remember, all relationships are between records. On record in a table relates to another record in another (or same) table. 

  • JT_Corrin Profile Picture
    104 on at

    They return the first Products table of contacts and the first Contacts table of products

     

    I get what you are saying though. Thanks for the assistance

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 354 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 330

#3
Mohsin Ali Profile Picture

Mohsin Ali 232

Last 30 days Overall leaderboard