cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
nikil
Level: Powered On

How to create relationship between custom tables in CDM

Hello

I have created two custom tables in CDM, item and item category. I want to create a relationship between these tables. I added Item Category field in Item table and picked data type as a Picklist. However in the properties pane's Picklist drop down, I do not find the custom Item Category table I have created.

 

Please advice.

 

Regards 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
DaveB
Level: Powered On

Re: How to create relationship between custom tables in CDM

Lookup's are history in CDS databases created in new environments. Now you manage relationships when designing an Entity.

EntityRelationships01.jpg

The screen shot shows Item - ItemCategory.

If you work with a legacy CDM database in a migrated environment it still has Lookup's.

Dave

7 REPLIES 7
Highlighted
DaveB
Level: Powered On

Re: How to create relationship between custom tables in CDM

Lookup's are history in CDS databases created in new environments. Now you manage relationships when designing an Entity.

EntityRelationships01.jpg

The screen shot shows Item - ItemCategory.

If you work with a legacy CDM database in a migrated environment it still has Lookup's.

Dave

nikil
Level: Powered On

Re: How to create relationship between custom tables in CDM

Thanks!

IsaiahA
Level: Powered On

Re: How to create relationship between custom tables in CDM

Thank you very much for your response. I did create the relationship as indicated. However, I do not know how to manage the keys (primary & foreign key). Is there a step by step process to relate keys the keys? 

 

Thanks, 

Isaiah A.

DaveB
Level: Powered On

Re: How to create relationship between custom tables in CDM

You drag-n-drop / delete fields to compose the entity key in the Keys tab...

 

EntityKey01.jpg

IsaiahA
Level: Powered On

Re: How to create relationship between custom tables in CDM

Sorry, it appears I am not making myself clear. Let me explain it further. Suppose I have an entity called "Title" with TitleID as my primary key. And I have another entity called Employee, which has is own primary key (EmployeeID), and a another column called TitleID. "Title" is the primary table and "Employee" is the secondary table. How do I relate Employee.TitleID with Title.TitleID in a one-to-many relationship? 

 

Thanks,

Isaiah. 

DaveB
Level: Powered On

Re: How to create relationship between custom tables in CDM

I have only discovered how to create 1-to-many lookup relationships.

#1 Make field 'TitleID' of Title entity the key

#2 For Employee entity create a relationship to Title entity and call it 'EmployeeTitleID'.

 

In #2 it creates a new extra field to support the relationship, the original 'Employee.TitleID' field is not used. I cannot see any way to reuse this field in the new CDS databases.

PowerApps Staff Vijeta
PowerApps Staff

Re: How to create relationship between custom tables in CDM

Hello IsaiahA,

 

When you create a relation from a child entity to a parent entity you are creating a 1:n relationship. We automatically create a lookup field on child entity and relate it with the primary key of the parent entity.

 

Thanks

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 178 members 4,658 guests
Please welcome our newest community members: