Relationship Between Tables In Dataverse Using Power App From MS Team

Introduction

 
Recently, Microsoft has released Dataverse for Microsoft Teams to build Power apps, compose flow/power automate to handle business processes and measures, and generate power BI Reports to dissect information without leaving the context of Microsoft Team.

In this article, I will articulate steps to make the relationship between tables inside Dataverse using Power apps from Microsoft Team.

Table of content
  1. Set up dataverse environment for Microsoft Team
  2. Create 2 Table in Dataverse
  3. Create a relationship between 2 table
Prerequisite
  1. Microsoft 365 enviornment
  2. Microsoft Team
Before moving ahead, I am assuming that you have Microsoft 365 account is with you, and one Microsoft Team is created in your environment.

Step 1 - Set up dataverse environment for Microsoft Team
  • Login in Microsoft Team 
  • Click on App Icon in Microsoft Team
  • Search "Power app" in the search box
  • Click on Add
Relationship between tables in Dataverse using PowerApp from MS Team
 
Once the power app installed successfully then you can see the below screen,

Relationship between tables in Dataverse using PowerApp from MS Team
 
I am sure that you have installed the power app in your team environment successfully.

Click on Start Now. When you click on "Start now", You will be asked to choose a team.

The user will get the message, 'You're the first person to create an app in this team. We'll need to do some setting up, so loading time will be a little longer than usual' It means that this process will create a separate environment for a particular selected team.

Relationship between tables in Dataverse using PowerApp from MS Team

You will get the below screen after the successful creation of the environment.

Relationship between tables in Dataverse using PowerApp from MS Team

Login to the Power Platform Admin center to check the environment.

Relationship between tables in Dataverse using PowerApp from MS Team

Step 2 - Create a table in Dataverse

To create a table, you need to create a Power App first.

Add Power App name as you like and click on,

Relationship between tables in Dataverse using PowerApp from MS Team

I am taking the example of the ticketing system. Tickets will be the primary table and the category will be the lookup list for Tickets.

I will demonstrate here the relationship between Tickets and category.

Once the app is created you will be redirected to the Power App environment where you can develop a Power App screen as well as tables in Dataverse which will be consumed by Power App as a Data Source.

To create a new table click on Create table and give the table name.

Relationship between tables in Dataverse using PowerApp from MS Team

Once the table is created, the User will be redirected to the screen from where they can create a column for the new table.

I am creating 3 columns for table Tickets,
  1. Name
  2. Description and 
  3. Due Date

Relationship between tables in Dataverse using PowerApp from MS Team
 
Now, time to create a second table that will be used for making a relationship with Tickets.

In my case, I am creating Table "Category". Create 2 columns, Name and Approval in Category,

Relationship between tables in Dataverse using PowerApp from MS Team
So, we have created 2 tables that are stored in data verse.

Now, we are looking forward to making a relationship between 2 tables.

Step 3 - Create a relationship between 2 tables

To start making a relationship, you need to reach the screen from where you can see the option to start making the relationship between tables.

Relationship between tables in Dataverse using PowerApp from MS Team
When you click on see all, you will be redirected to the below screen.

Here, you have control to manage artifacts for a specific team. 

Relationship between tables in Dataverse using PowerApp from MS Team

You need to select a table where you want to set up a relationship with another table.

Relationship between tables in Dataverse using PowerApp from MS Team

Here you can see a number of available columns as well as a number of views that are default created by the system

In a Relationships tab, You can see multiple columns which are associated with another table from Dataverse.

i.e. Created By column is lookup column and it is associated with User Table.

Relationship between tables in Dataverse using PowerApp from MS Team

To make a relationship with a custom table, click on the "Add Relationship" button and select the type of the relationship "Many to Many", "One to Many" or "Many to One" based on your need.

To learn more about the relationship concept click here.

Relationship between tables in Dataverse using PowerApp from MS Team

Here you can see, Tickets are in the current Table, and in the Related section, you can select a custom table from the list of tables.

A look-up column will be created based on the selection of the table.

After clicking on Done you will see the category column in the list of relationship sections as well as in the column section.

Let's test this relationship for some value.

I added 2 entries in the category table as below,

Relationship between tables in Dataverse using PowerApp from MS Team

After publishing App to Team's channel as a tab, it looks as below and you can access category table values while making entry from Power Apps.

Relationship between tables in Dataverse using PowerApp from MS Team

I hope you get all points covered in this article. I will be happy to assist you in case of any question or query.

Happy Coding