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 / Updating Many-To-Many ...
Power Apps
Unanswered

Updating Many-To-Many Relationship

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Howdy All,

 

I am trying to update a Many-To-Many relationship using a Combo Box in a form.

 

This code seems to Unrelate all of the items in first table and then Related all items in the second table.

 

// Update Applications for Producing Information Flows
UpdateContext({tblIteration:InformationFlowGallery.Selected.'Applications (cr182_ProducingApplication)'});
UpdateContext({tblIteration2:DataCardValue36.SelectedItems});
Notify(Concatenate("I1 = ", CountRows(tblIteration)," I2 = ", CountRows(tblIteration2)), Information, 3000);

// Remove Dropped Apps
ForAll(tblIteration, 
 If( 
 Not(ThisRecord exactin tblIteration2),
 Unrelate(InformationFlowGallery.Selected.'Applications (cr182_ProducingApplication)', ThisRecord); Notify("Unrelated", Information,1000)
 )
);
// Include New Producing Apps
ForAll(
 tblIteration2, 
 If(
 Not(ThisRecord exactin tblIteration),
 Relate(InformationFlowGallery.Selected.'Applications (cr182_ProducingApplication)', ThisRecord); Notify("Related", Information, 1000)
 )
);

 

My hope was that it would unrelate items that in the many-to-many relationship but not in the updated combo-box selection and relate records in the updated combo-box selection but not in the many-to-many relationship.

 

I've tried with "in" and "exactin" and seems to behave similarly, i.e. both unrelate all records and then relate all records.

 

Thanks in advance for any suggestions.

 

Cheers,
Ashley.

 

Categories:

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 339 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 289

#3
Mohsin Ali Profile Picture

Mohsin Ali 228

Last 30 days Overall leaderboard