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

Common Data Service for Apps: Lookup from a Task entity to a Contact entity

Hi Community,

 

I am a newbie with PowerApps and in particular CDS for Apps. I have a working app in PowerApps using a SharePoint list, that looks up a SharePoint Contacts list, and pulls in several fields. That works fine. 

 

However, I've realised that SharePoint Contact lists were short lived and I cannot create an app in PowerApps that can customise or edit my existing SharePoint contact list. So I thought I may as well recreate my app using CDS for Apps for data storage rather than SharePoint, so I could harness the power of existing entities which I can customise. 

 

I figured I could use the Task entity in CDS for Apps, as my original SharePoint list on which my app is based, largely matches the fields in this entity. I would have to create some new fields which is no problem. I can see that the Task entity has a many-to-one relationship with the Contact entity, with the Relationship name Contact_Tasks, and Lookup field name RegardingObjectId. However, there are no inbuilt fields making use of this relationship. If I create a new lookup field in the Task entity to reference the Contact entity, it creates a new lookup relationship, which is not what I want.

 

How can I make use of the existing relationship between the Task and Contact entities in CDS for Apps, and create a lookup field in the Task entity to the Contact entity?

3 REPLIES 3
Community Support Team
Community Support Team

Re: Common Data Service for Apps: Lookup from a Task entity to a Contact entity

HI @Zedian ,

Do you want to use the existing Relationship (Many-to-One) between the Task Entity and the Contact Entity in your CDS within your app?

 

I have made a test on my side, if you want to use the existing Relationship (Many-to-One) between the Task Entity and the Contact Entity in your CDS within your app, I afraid that there is no way to achieve your needs in PowerApps currently.

Currently, within CDS, the exitsing Relationship (one-to-many or many-to-one) between Standard/System Entities would not be displayed/decorated as a LookUp field in corresponding Entity.

 

If you would like this feature to be added in PowerApps, please submit an idea to PowerApps Ideas Forum:

https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas

 

As an alternative solution, you could consider take a try to re-create a new Relationship between your Task Entity and Contact Entity.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Zedian
Level: Powered On

Re: Common Data Service for Apps: Lookup from a Task entity to a Contact entity

Hello @v-xida-msft ,

 

Many thanks for the explanation and suggestion. It's a bit of disappointment that the existing system relationships are not available to be used as I had intended, because really that is the next step in giving developers the ability to harness the power of CDS.

 

I've ended up creating a whole new custom entity, similar to the Task entity, just in case something else might gets messed up in the existintg system relationship between the Task and Contact entitities. I've also created a many-to-one relationship between this new custom entity and the Contact entity.

 

After much head-scratching I've managed to create data cards that retrieve fields from the Contact entity, using the lookup in the new custom entity. This area is not well documented in the PowerApps documentation by Microsoft. 

 

I'll make the suggestion to the Ideas forum. Thanks for your help.

Zedian
Level: Powered On

Re: Common Data Service for Apps: Lookup from a Task entity to a Contact entity

Hello again @v-xida-msft ,

 

I stumbled upon this blog: https://powerapps.microsoft.com/en-us/blog/one-to-many-relationships-for-canvas-apps/ 

 

It does appear that using entity relationships is pretty much work in progress, adn the author does say we should expect a bit of pain.