web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

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:
I have the same question (0)
  • 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard