cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Mike_Guzowski Kudo Commander
Kudo Commander

Create many-to-many relationship using Flow

Hi,

 

I have 2 CDS entities related with many-to-many relationship. I want to relate 2 records from both entities together but unfortunately Microsoft Flow can't do it. Using PowerApps is not an option (need to do it in a loop). How can I achieve it?

 

Regards,

Mike

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Create many-to-many relationship using Flow

Hi @Mike_Guzowski 

When a many to many relationship is created in the CDS, I believe this is actually creating a link entity with two 1 to many relationships. This link entity is then hidden and you have no way to access or modify it. In order to get more control over the relationship and achieve your requirement, I think you will need to create the link entity manually.

For example if you have Entity A and Entity B that need to be linked using a many to many. Create a new entity (Entity C) and add lookup fields to both Entity A and Entity B. This will create a 1 to many from your link entity to both A and B, and therefore creating a many to many between A and B.

 

image.png

 

Then, when you want to create the relationship within Flow. You simply create a new record (Entity C) and set the lookup values for Entity A and Entity B.

Hope that all makes sense.

 


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


Follow me on Twitter at @QG_LeeJHarris

Or on LinkedIn at in/leejharris

View solution in original post

2 REPLIES 2
Super User
Super User

Re: Create many-to-many relationship using Flow

Hi @Mike_Guzowski 

When a many to many relationship is created in the CDS, I believe this is actually creating a link entity with two 1 to many relationships. This link entity is then hidden and you have no way to access or modify it. In order to get more control over the relationship and achieve your requirement, I think you will need to create the link entity manually.

For example if you have Entity A and Entity B that need to be linked using a many to many. Create a new entity (Entity C) and add lookup fields to both Entity A and Entity B. This will create a 1 to many from your link entity to both A and B, and therefore creating a many to many between A and B.

 

image.png

 

Then, when you want to create the relationship within Flow. You simply create a new record (Entity C) and set the lookup values for Entity A and Entity B.

Hope that all makes sense.

 


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


Follow me on Twitter at @QG_LeeJHarris

Or on LinkedIn at in/leejharris

View solution in original post

Highlighted
Mike_Guzowski Kudo Commander
Kudo Commander

Re: Create many-to-many relationship using Flow

Thanks @LeeHarris . This is how I've workarounded this relationship so far but TBH I think it's a temporary solution. Especially that CDS allow for creating N:N relationship so the lack of functional support seems to be a bug to me.

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,768)