Reply
Level 8
Posts: 43
Registered: ‎05-09-2017

Removing A Relationship Between Records (CDS)

Can someone explain to me how to remove a relationship between two specific records in the CDS? For example, I have two Entities named Person and Team. I have a relationship in the CDS that connects the two. I can connect a Person to a Team, but I need to know how to remove a Person from a Team. I don't need to remove the relationship between the entities; I need to remove the relationship between the records contained within the entities.

Any help here would be great. Thanks.

Community Support Team
Posts: 3,909
Registered: ‎06-22-2016

Re: Removing A Relationship Between Records (CDS)

Hi TonyHart,

 

I assume that this documentation could be your reference:
https://powerapps.microsoft.com/en-us/tutorials/data-platform-entity-lookup/

 

Please check this part about how to delete a record with a Lookup relationship:

3.PNG

 

Best regards,
Mabel Mao

Level 8
Posts: 43
Registered: ‎05-09-2017

Re: Removing A Relationship Between Records (CDS)

Hi @v-yamao-msft,

I do not need to delete a record. I need to remove a relationship between two records.

 

For example, If record A has a lookup relation to record B, I need to delete the lookup relationship between the two records. I don't need to remove the relationship between the entity, nor do I need to delete a record. I just need to delete the relationship between two records.

 

Thanks

Level: Powered On
Posts: 16
Registered: ‎08-20-2017

Re: Removing A Relationship Between Records (CDS)

Hi:

 

Excuse me for the interruption, but can you tell me how to create a entity relationship like it is describe here?

 

https://www.youtube.com/watch?v=-fQ-bRllhXc

 

I know how to create a lookup relation, but haven't figure out how to create a normal, self or one to many relationship between entities. (like it is said in the link you attached: https://powerapps.microsoft.com/en-us/tutorials/data-platform-entity-lookup/

 

Highlighted
Level 8
Posts: 43
Registered: ‎05-09-2017

Re: Removing A Relationship Between Records (CDS)

@v-yamao-msft

 

Any updates on this?

Level: Powered On
Posts: 13
Registered: ‎02-16-2017

Re: Removing A Relationship Between Records (CDS)

Hi Tony,

 

I had the same problem and couldn't find a good solution.

What I do as a (temporary) simplistic workaround: create a fictive Team (name it "-" ) and place the Person in that Team.

Any better solution from the PowerApps team?

 

Chris

PowerApps Staff
Posts: 273
Registered: ‎08-29-2016

Re: Removing A Relationship Between Records (CDS)

Hi Tony,

 

Can you confirm if you are referring to the Team and Person entities that are shipped with CDS, or just using that as an example? I'll try and answer for both just in case.

 

For the Team and Person that exist within the model that comes with CDS, there is a third entity that maintains a many-to-many relationship for Team and Person (a Team can have many people, and a person can be a part of many teams). This entity is called "Team member" and if you wish to remove a relationship between a Team and Person, you would delete the record in "Team member" that connected the two.

 

For your more generic example, where Entity A has a lookup field to Entity B and you want to remove the relationship of a specific record - you should be able to simply clear the value from the field in Entity A (unless you have made it required) which would remove the relationship on the specific record, but not the entities themselves.

 

Let me know if I've misunderstood.

 

Thanks