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

Community site session details

Session Id :
Power Apps - Microsoft Dataverse
Suggested Answer

How to detect change in Many-to-Many relationship?

(0) ShareShare
ReportReport
Posted on by
Hi,
 
In Dataverse I have 2 tables: Employees (com123_employee) and Events (com123_event) which have Many-to-Many relationship (com123_event_com123_employee). We want to be able to run a Power Automate Flow every time an Employee is related/unrelated from Event.
 
User Story:
Customer would like to:
1. add an Event to an Employee object via the Event subgrid. => Do actions: Say create a new record in Excused Absence table with Employee and Event. Create new record in Attendance table with Employee and Event.
2. remove an Event from the Employee subgrid. => Do actions: Delete the created records in Excused Absence and Attendance table.
 
I tried creating a Power Automate flow to detect change to com123_event_com123_employee table (as a custom table name), but it doesn't seem to work.
 
Is there any OOB functionality that can achieve this? We normally create the data structure and pass it off to clients, so we can't over-customize the system.
 
Thanks
I have the same question (0)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    52,851 Super User 2025 Season 2 on at
    How to detect change in Many-to-Many relationship?
     
    To be honest I almost never use the M/M I have my own intersect tables for many reasons this is one of them and because I want to associate extra attributes to the relationship that I do not want in either table.
     
    Silly example
     
    Students
    Projects
     
    Intersect Table
    Student Id, Project Id, Project Start Date (because it could be a different time period for a different group of students) 
     
    lame but real example.
     
    Ok to answer you, can I please verify, when you say relate do you literally mean you are using the relate feature?
     
    What you explained in your 
    1 and 2 make no sense that it doesn't work in PA as its specifically designed just for that so can you give more details than just it doesn't work as I would need to see your Flow, your trigger and a walk through of your actions you took (wherever) to make sure you have the triggers configured properly as anytime you add, delete or modify records its OOB functionality for it to trigger the flows and only misconfigurations or details I am not aware of above would stop it from doing that.
     

    If these suggestions help resolve your issue, Please consider Marking the answer as such and also maybe a like.

    Thank you!
    Sincerely, Michael Gernaey
  • Ram Prakash Profile Picture
    5,576 Super User 2025 Season 2 on at
    How to detect change in Many-to-Many relationship?
     
    If you are using Plugins in C#, we are having an option called ASSOCIATE and DISASSOCIATE option to find the same like when a record gets Mapped then it will call Associate operation, if you are removing it will call Disassociate Operation
     
    Please mark as answer if my suggestion helps.
    Subscribe here for More Useful videos : https://www.youtube.com/@rampprakash3991
  • Suggested answer
    Fubar Profile Picture
    8,319 Super User 2025 Season 2 on at
    How to detect change in Many-to-Many relationship?
    For a native many-to-many you cannot do it directly in Power Automate Flow as there is not a trigger for it.
    There is a slight workaround using a web hook to pick up the change then have it call a flow to do the processing. For this approach see an outline in the suggested answer by Jelle in this post https://community.powerplatform.com/forums/thread/details/?threadid=0ec9b1fa-51f7-4f42-985d-0c4312a6f0fd
    (note: if using a HTTP flow you also need to make sure it is secured as by default it is exposed to the world)
     
    The traditional way (and I believe the better way for this scenario) is to create a .NET Plugin that is registered on the Associate & Disassociate actions - if you want to maintain some configurability rather than doing it all in code your plugin code could call a Dataverse Action.
  • Suggested answer
    wolenberg_ Profile Picture
    1,013 Moderator on at
    How to detect change in Many-to-Many relationship?
    Hello , uou’re on the right track the trick is that in Dataverse, a many‑to‑many relationship is implemented through an intersect table(in your case `com123_event_com123_employee`). That table is just like any other custom table, so you can trigger flows on it.  
     
    How to handle it
    - Adding a relationship: When a row is created in the intersect table, that means an Employee has been linked to an Event. You can trigger a flow on Create of `com123_event_com123_employee` and then use the Employee and Event IDs from that row to create your related records in Excused Absence and Attendance.
     
    - Removing a relationship: When a row is deleted from the intersect table, that means the Employee was unlinked from the Event. You can trigger a flow on Delete of `com123_event_com123_employee` and then use those IDs to find and delete the related records.  
     
    Limitations
    - There isn’t an out‑of‑the‑box “relationship changed” trigger you have to use the Create/Delete triggers on the intersect table.  
    - If you tried to set the flow on the intersect table and it didn’t fire, double‑check that the table is enabled for change tracking and that you selected the correct logical name (`com123_event_com123_employee`).  
    - You don’t need to over‑customize this approach works with standard Power Automate triggers.  
     
    In short: use the Create/Delete triggers on the intersect table to detect when an Employee is linked or unlinked from an Event, then branch your flow to add or remove the related records. That’s the supported way to achieve your scenario without heavy customization.  
     
     
    If this helped or could help others in the community, feel free to give it a like or a kudo — it helps surface useful answers for everyone!

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

Coming soon: forum hierarchy changes

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 803 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 314 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 253 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics