Exercise - Create a cloud flow with a Dataverse connector
Your organization wants to ensure that when a new contact is created, they're only marked Active if no existing contact has the same email. If a duplicate is detected, the status should remain New for manual review. By the end of this module, learners are able to:
- Create an automated cloud flow using the Dataverse connector
- Use the List rows action with a filter expression
- Update a Dataverse row based on conditions
- Understand how to avoid duplicate data entries in Microsoft Dataverse
Set up the contacts table (skip if table already exists)
Navigate to Power Apps maker portal.
Select Tables on the left side.
Select New table and Create new tables in the top left.
Choose Start from blank.
Name the table Contact.
Change the Primary Column to Full Name.
Create a new text column called Email and set it to required.
Create another new column called Status and make it a choice column. Change the choices to be New, Active and Inactive. Your table should look like the image below:
When done, choose Save and exit in the top right corner.
Create the cloud flow
Navigate to Power Automate maker portal.
Select Create from the left side and then choose Automated cloud flow.
Name your flow:
Check for Duplicate Contacts
.Select trigger: When a row is added, modified, or deleted (Microsoft Dataverse).
Select Create.
Select the When a row is added, modified, or deleted trigger and change type to Added.
Choose the Contacts table.
Change scope to Organization.
Under the trigger, select the + icon to add a new step.
Search for List rows under Microsoft Dataverse.
Choose the Contacts table, then under Filter rows type
emailaddress1 eq ''
Place your cursor between the two single quotes and select the lightning bolt icon on the right side of the text box. Then choose Email from the dynamic data. Your action looks like this image:
Under the List rows action, select the + icon to add a new step.
Search for and add the Condition action.
Select the condition action and on the left side of the formula select the fx icon to add a function, then copy and paste this function and select Add
length(body('List_rows')?['value'])
Set the value on the right side of the formula to 1. This checks that only one contact exists with that email (that is, the one just added). If more exist, it's a duplicate. Your condition should look like the image below:
Under the True branch, select the + icon to add a new step.
Search for and add the Update a row action under Microsoft Dataverse.
Choose the Contacts table.
For the Row ID, select the lightning bolt icon to show the dynamic data and search for Contact. Choose the Contact column under the When a row is added, modified, or deleted section. This is the unique identifier of the table.
Under Advanced Parameters, search for Status and set the value to Active.
Save the flow in the top right corner.
In a new tab, navigate to the Power Apps maker portal.
Select Tables on the left side, find, and select the Contacts table.
Select Edit on the right side of the table data.
Select + New row at the top and enter a new contact with a unique email.
Add another contact with the same email to test the duplicate logic.
Check flow runs in Power Automate > My flows > Run history.
Summary
In this exercise, you:
Created a cloud flow triggered by a Dataverse record creation
Used a filtered List rows to check for duplicate email addresses
Conditionally updated the contact's status to Active