Thursday, October 8, 2020

Get N: N relationship records in Canvas App using CDS/Dataverse – Power Platform

Note- We have to use Dataverse connector instead of CDS now, steps would be same.

Scenario

Let us assume there are two entities with N: N Relationship and we need to show the related records on Canvas App.

Lets get started.

1.  Entity Design

Entity 1 – First (Project records are stored in this entity)

Entity 2 – Second (Resource records are stored in this entity)

Relationship – N:N

We associate few Resources to Project in CDS as below-


Now we want to visualize this data in canvas app. Let us see further steps.

2. Enable Entities for Change Tracking

We need to enable change tracking for both the entities to access N:N data.

First Entity- This store Project Records


Second Entity - This store Resource Records

3.  Create canvas app 

Go to https://make.powerapps.com/, click on “Create”, select Canvas app from blank.


We will see a blank screen to which we will add controls from the ribbon



Our screen is ready.


4. Attach data source to canvas app.

Click on Project dropdown and in the Properties window provide entity and column you want to display in the dropdown.


Click on Resources Datatable and data custom data source from the formula bar –


To add columns to the 
Datatable select the control, go to properties, click “Edit fields” and add required fields.



All done, Let’s run the app.

Output – On selection of Project, only associated records shown in the Datatable.




Happy Learning, LET’S SHARE!

No comments:

Post a Comment

Popular Posts