cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Daved1
Helper II
Helper II

How to create a custom junction table for Many to Many relationship

I want to create a junction table for a many to many link.  I saw this post 

Solved: Create view for a Many to Many relationship using ... - Power Platform Community (microsoft....

 

How do I create a table in Dataverse that does not include the Name as the primary field  (Text).  I want to use a ID as primary field (Number).  Dataverse always adds the Name field when i create a new table.

 

This is the table I am trying to create

Daved1_0-1637000191062.png

 

Regards

Dave

1 ACCEPTED SOLUTION

Accepted Solutions

@Daved1 The junction table is basically a table with 2 fields where each field has a 1:N relationship (LookUp) with another table. If you want you can create you own junction table, you need these two fields plus any other fields according to your requirement. Further, when you create the table, you can give a name for the Primary Name Column as you like and also later (before saving the table) change its data type to AutoNumber if that's what you want.

CNT_0-1637005690902.png

CNT_1-1637005935120.png

 

View solution in original post

6 REPLIES 6
CNT
Super User
Super User

@Daved1 When you create a Many-to-Many relationship in Dataverse, it automatically creates this 'junction' table. You also don't have to worry about the fields as the relationship is between the record(s) in one table to the record(s) in the other table and not between any specific column(s). Check here for more info, https://docs.microsoft.com/en-gb/powerapps/maker/data-platform/data-platform-entity-lookup#add-a-man...

Daved1
Helper II
Helper II

Thanks for your response.

 

I am currently using the out of the box Dataverse 'Junction' table.  However, i need to add columns now to this table.  The simple 2 column out of the box table does not work for my application.  This is why i need to create the custom junction table.

 

@Daved1 The junction table is basically a table with 2 fields where each field has a 1:N relationship (LookUp) with another table. If you want you can create you own junction table, you need these two fields plus any other fields according to your requirement. Further, when you create the table, you can give a name for the Primary Name Column as you like and also later (before saving the table) change its data type to AutoNumber if that's what you want.

CNT_0-1637005690902.png

CNT_1-1637005935120.png

 

That is exactly what I am looking for.

 

However, I still can't find it.  i do not see the option to change the Data Type.  I must be blind...

 

Daved1_0-1637153854625.png

 

OK - I get it now.

 

So I created a new table in my Solution. I had to hit save (only option).

Then after the table was created, i was able to click on the column and change it to Autonumber

 

Thank you so much for your help.  THis was driving me crazy


Dave

@Daved1 While creating the table you can't change it. After you create, go to that field and then you will be able to change it as seen below,

CNT_0-1637154622341.png

 

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (2,724)