Import CSV Data to Microsoft Dataverse Using Power Automate

One of my clients had a large amount of data exported from Salesforce in CSV format and needed a way to import it into Microsoft Dataverse.

Instead of manually uploading the data or writing custom code, we used Power Automate to import the CSV data directly into a Dataverse table.

In this tutorial, I will show you how to import CSV data to Dataverse using Power Automate.

Import CSV Data to Microsoft Dataverse Using Power Automate

In this example, I will be importing a list of employees into the Contact table in Microsoft Dataverse. The data is stored in a CSV file that contains columns like:

  • Name
  • Email
  • Department
  • Phone
power automate import csv to dataverse

The above CSV file is present in the SharePoint Document library called DocumentApproval.

dataverse import data from excel

Here, we will use Power Automate to read each row from the CSV and create a new record in the Contact table for each entry.

Now follow the steps below:

  1. Open the Power Automate home page, click + Create, select the Instant cloud flow, enter the flow name, and choose the trigger’s flow (manually trigger the flow).
  2. Next, add ‘Get file content’ and provide the Site address and File Identifier to retrieve the CSV file.
power Automate import data from excel to dataverse
  1. Add a Compose action. In the Inputs field, enter the following expression to convert the file content from Base64 to plain text:
base64ToString(body('Get_file_content')?['$content'])
import data from dataverse using Power Automate
  1. Then, add the ‘Compose‘ flow action, enter the inputs, and then leave.
import data from excel to dataverse using power automate
  1. Add another Compose action. In the Inputs field, enter the following expression:
skip(split(outputs('Compose_|_Csv'),outputs('Compose_|_New_Line')),1)
import data from CSV to dataverse power automate
  1. Next, add the Filter array action to selectively include or exclude elements from an array based on specified conditions and set the required fields.
    • From: Here, I have given the Outputs of the Array(Compose) flow action from dynamic content.
item() is not equal to ' ' 
import CSV files to Dataverse with Power Automate
  1. Add an Apply to each action. In the Select an output from previous steps field, use the output from the Filter array action:
How to Import CSV Data to Dataverse in Power Automate
  1. Inside the Apply to each loop, add the Add a new row action (from the Microsoft Dataverse connector). In the Table name, select Contacts (or Contact if you’re seeing the schema name).
    • Now, map the fields from the CSV to the corresponding columns in the Contact table. To do this:
      • First Name – outputs(‘SplitRow’)[0]
      • Email – split(item(),’,’)?[1]
      • Department – split(item(),’,’)?[2]
      • Business Phone – split(item(),’,’)?[3]
CSV data import using Power Automate flow
  1. Once all the steps are added, click Save in the top-right corner of the Power Automate designer. After saving, click “Test,” then select “Manually,” and finally click “Run Flow.” Wait for the flow to finish. You’ll see a green checkmark for each step if it runs successfully.
  2. Then, go to the Microsoft Dataverse and open the Contacts table; you can see the data added successfully.
Import CSV Data to Microsoft Dataverse Using Power Automate

Using Power Automate, you can quickly import data from a CSV file into Microsoft Dataverse, with no coding needed.

This method is excellent when you have a large amount of data (such as from Salesforce exports) and want to automate the process.

You can also modify the flow to work with other Dataverse tables and update the field mappings based on your data.

Hope you found this helpful!

Other Dataverse articles you may also like:

Power Apps functions free pdf

30 Power Apps Functions

This free guide walks you through the 30 most-used Power Apps functions with real business examples, exact syntax, and results you can see.

Download User registration canvas app

DOWNLOAD USER REGISTRATION POWER APPS CANVAS APP

Download a fully functional Power Apps Canvas App (with Power Automate): User Registration App