Skip to main content
Community site session details

Community site session details

Session Id : Gckk42BCDCnS3BGlxNvEZk
Power Apps - Microsoft Dataverse
Answered

CDS data flows How to import data with many to many relationship

Like (0) ShareShare
ReportReport
Posted on 7 Jun 2020 15:44:33 by 128

Dear community

I have built a model-driven app and I am in process to import data to CDS using data flows.

The data source is in Excel.

I have been able to map look-up fields based on this article 

https://dynamicscitizendeveloper.com/2020/04/21/how-to-map-a-lookup-field-in-a-power-platform-dataflow/

 

Is it possible to import data to a field that has a many-to-many relationship to my entity?

Thanks in advance

   

  • jontylp Profile Picture
    8 on 28 Dec 2023 at 10:05:34
    Re: CDS data flows How to import data with many to many relationship

    @AndyHowes , I've cloned your Git repo and got it all firing in Python. Thanks so much for your very helpful post and blog write up on the instructions to set it all up (was a lot easier than I thought) though getting Postman up and running with OATH 2.0 was a bit tricky 😕 

     

    One tip I'll add for anybody else trying to go this route is to get to first get to grips with ODATA (rather than doing as I did and trying to modify Python scripts blindly, praying something would work) - specifically "Using collection-valued navigation properties" (Associate and disassociate table rows using the Web API (Microsoft Dataverse) - Power Apps | Microsoft Learn) and how Navigation Properties work in general. Probably an obvious thing to say, but I spent hours trying to figure out what Navigation Property name to use to link the actual records was and that you actually don't need to directly poke around with the "hidden" table that links the many-to-many records together. 

     

    Thanks again! 🙂

  • jontylp Profile Picture
    8 on 26 Dec 2023 at 04:23:59
    Re: CDS data flows How to import data with many to many relationship

    Thanks @AndyHowes  I'm arms deep in Python to get this done 🙂 Appreciate the help and have a good Christmas!

  • AndyHowes Profile Picture
    15 on 21 Dec 2023 at 21:54:21
    Re: CDS data flows How to import data with many to many relationship

    Sorry it took a while to respond. As far as I’m aware is still no out of the box way to import many to many relations. You can use the python library above, but another option is XRM toolbox, it’s pretty easy to use and there’s a tool in there that lets you import many to many relationships.

     

    https://www.xrmtoolbox.com/plugins/Javista.XrmToolBox.ManageNN/

    https://www.xrmtoolbox.com/documentation/for-users/first-steps-with-xrmtoolbox/

     

  • jontylp Profile Picture
    8 on 19 Dec 2023 at 01:00:17
    Re: CDS data flows How to import data with many to many relationship

    Hi guys,

     

    Trying to do a similar thing here - I've got a Books table and an Authors table and trying to link the two together (Many to Many relationship). Easy to create the relationship but is there still no "easy" way to import Book data and Author data (from Excel) and link the two without resorting to Python scripts or creating a Flow? The underlying relationship table that gets created to manage the relationships seems completely hidden (even in the Solution Explorer) and I'm not sure how to actually get data into it short of resorting to the API which seems insane to have to do? 🙂 Thanks for the help!

  • AndyHowes Profile Picture
    15 on 08 Jul 2023 at 06:02:40
    Re: CDS data flows How to import data with many to many relationship

    The lack of this feature really frustrated me with Dataflows, so I created a Python library that lets you import Many to Many relationship data easily to Dataverse.

     

    The blog explains how to set up the Azure app to get access to Dataverse, and it's set up to let you access the data using your own credentials so you don't need to set up a user just for the API.

     

    Blog: https://andyhowes.co/easily-connect-to-dataverse-microsoft-dynamics-with-python/

    Code: https://github.com/YesWeCandrew/PyConnectDataverse

     

    Use the pcd_add_m2n_data.py file. You just require a table with the GUIDs of the two records you want to link into together in the many to many relationship.

  • Verified answer
    Joel CustomerEffective Profile Picture
    3,224 on 07 Jun 2020 at 18:45:56
    Re: CDS data flows How to import data with many to many relationship

    Yes. Use power automate and the relate records step. You need to create a flow from a solution and use the connector called cds current environment. Here is a great post about it https://www.google.com/amp/s/tattooedcrmgirl.com/2019/10/30/microsoft-flow-the-relate-records-action-demystified/amp/

     

    you can put your excel in onedrive and connect with flow and create or update records in cds

  • Verified answer
    H Sheild Profile Picture
    3,005 Most Valuable Professional on 07 Jun 2020 at 18:44:18
    Re: CDS data flows How to import data with many to many relationship

    hi @SandraSoniec 

     

    This is not possible at the moment using dataflows as the relationship entity (hidden entity that joins entities in a many to many relationship) does not seem to be available to select on the mapping page.  As an example, I just had a look at mapping the Lead - Product many to many relationship and these two entities are related via LeadProduct entity.  This entity doesn't exist as an option to map.

     

    Additionally this article also says that many to many relationships for dataflows are not supported

    https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/cds-odata-dataflows-migration#limitations

     

    You could add an Idea so that the product team know that people want this https://powerusers.microsoft.com/t5/Ideas/ct-p/PA_Comm_Ideas

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 637 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 570 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 473

Featured topics

Loading complete