Extract information in Excel using Power Automate - Azure AI services (2024)

  • Article

In this tutorial, you'll create a Power Automate flow to extract text in an Excel spreadsheet without having to write code.

This flow will take a spreadsheet of issues reported about an apartment complex, and classify them into two categories: plumbing and other. It will also extract the names and phone numbers of the tenants who sent them. Lastly, the flow will append this information to the Excel sheet.

In this tutorial, you'll learn how to:

  • Use Power Automate to create a flow
  • Upload Excel data from OneDrive for Business
  • Extract text from Excel, and send it for Named Entity Recognition(NER)
  • Use the information from the API to update an Excel sheet.

Prerequisites

  • A Microsoft Azure account. Create a free account or sign in.
  • A Language resource. If you don't have one, you can create one in the Azure portal and use the free tier to complete this tutorial.
  • The key and endpoint that was generated for you during sign-up.
  • A spreadsheet containing tenant issues. Example data for this tutorial is available on GitHub.
  • Microsoft 365, with OneDrive for business.

Add the Excel file to OneDrive for Business

Download the example Excel file from GitHub. This file must be stored in your OneDrive for Business account.

The issues are reported in raw text. We will use the NER feature to extract the person name and phone number. Then the flow will look for the word "plumbing" in the description to categorize the issues.

Create a new Power Automate workflow

Go to the Power Automate site, and log in. Then select Create and Scheduled flow.

On the Build a scheduled cloud flow page, initialize your flow with the following fields:

FieldValue
Flow nameScheduled Review or another name.
StartingEnter the current date and time.
Repeat every1 hour

Add variables to the flow

Create variables representing the information that will be added to the Excel file. Select New Step and search for Initialize variable. Do this four times, to create four variables.

Add the following information to the variables you created. They represent the columns of the Excel file. If any variables are collapsed, you can select them to expand them.

ActionNameTypeValue
Initialize variablevar_personStringPerson
Initialize variable 2var_phoneStringPhone Number
Initialize variable 3var_plumbingStringplumbing
Initialize variable 4var_otherStringother

Read the excel file

Select New Step and type Excel, then select List rows present in a table from the list of actions.

Add the Excel file to the flow by filling in the fields in this action. This tutorial requires the file to have been uploaded to OneDrive for Business.

Select New Step and add an Apply to each action.

Select Select an output from previous step. In the Dynamic content box that appears, select value.

Send a request for entity recognition

If you haven't already, you need to create a Language resource in the Azure portal.

Create a Language service connection

In the Apply to each, select Add an action. Go to your Language resource's key and endpoint page in the Azure portal, and get the key and endpoint for your Language resource.

In your flow, enter the following information to create a new Language connection.

Note

If you already have created a Language connection and want to change your connection details, Select the ellipsis on the top right corner, and select + Add new connection.

FieldValue
Connection NameA name for the connection to your Language resource. For example, TAforPowerAutomate.
Account keyThe key for your Language resource.
Site URLThe endpoint for your Language resource.

Extract the excel content

After the connection is created, search for Text Analytics and select Named Entity Recognition. This will extract information from the description column of the issue.

Select in the Text field and select Description from the Dynamic content windows that appears. Enter en for Language, and a unique name as the document ID (you might need to select Show advanced options).

Within the Apply to each, select Add an action and create another Apply to each action. Select inside the text box and select documents in the Dynamic Content window that appears.

Extract the person name

Next, we will find the person entity type in the NER output. Within the Apply to each 2, select Add an action, and create another Apply to each action. Select inside the text box and select Entities in the Dynamic Content window that appears.

Within the newly created Apply to each 3 action, select Add an action, and add a Condition control.

In the Condition window, select the first text box. In the Dynamic content window, search for Category and select it.

Make sure the second box is set to is equal to. Then select the third box, and search for var_person in the Dynamic content window.

In the If yes condition, type in Excel then select Update a Row.

Enter the Excel information, and update the Key Column, Key Value and PersonName fields. This will append the name detected by the API to the Excel sheet.

Get the phone number

Minimize the Apply to each 3 action by clicking on the name. Then add another Apply to each action to Apply to each 2, like before. it will be named Apply to each 4. Select the text box, and add entities as the output for this action.

Within Apply to each 4, add a Condition control. It will be named Condition 2. In the first text box, search for, and add categories from the Dynamic content window. Be sure the center box is set to is equal to. Then, in the right text box, enter var_phone.

In the If yes condition, add an Update a row action. Then enter the information like we did above, for the phone numbers column of the Excel sheet. This will append the phone number detected by the API to the Excel sheet.

Get the plumbing issues

Minimize Apply to each 4 by clicking on the name. Then create another Apply to each in the parent action. Select the text box, and add Entities as the output for this action from the Dynamic content window.

Next, the flow will check if the issue description from the Excel table row contains the word "plumbing". If yes, it will add "plumbing" in the IssueType column. If not, we will enter "other."

Inside the Apply to each 4 action, add a Condition Control. It will be named Condition 3. In the first text box, search for, and add Description from the Excel file, using the Dynamic content window. Be sure the center box says contains. Then, in the right text box, find and select var_plumbing.

In the If yes condition, select Add an action, and select Update a row. Then enter the information like before. In the IssueType column, select var_plumbing. This will apply a "plumbing" label to the row.

In the If no condition, select Add an action, and select Update a row. Then enter the information like before. In the IssueType column, select var_other. This will apply an "other" label to the row.

Test the workflow

In the top-right corner of the screen, select Save, then Test. Under Test Flow, select manually. Then select Test, and Run flow.

The Excel file will get updated in your OneDrive account. It will look like the below.

Next steps

Extract information in Excel using Power Automate - Azure AI services (2024)

FAQs

How to extract data from Excel with Power Automate? ›

How to Get Data from Excel in Power Automate
  1. Step 1: Create a New Flow. Creating a new flow in Power Automate involves a series of steps. ...
  2. Step 2: Choose the Excel Connector. ...
  3. Step 3: Select the Excel File and Worksheet. ...
  4. Step 4: Define the Data to Retrieve. ...
  5. Step 5: Save and Test the Flow.

How do I get data from Azure to Excel? ›

To connect Excel to a database in SQL Database, open Excel and then create a new workbook or open an existing Excel workbook. In the menu bar at the top of the page, select the Data tab, select Get Data, select From Azure, and then select From Azure SQL Database.

How to automatically extract data from Excel? ›

There are different methods that allow you to do this. Data extraction automation. You can connect your Excel workbook to another spreadsheet, database, or BI tool using Coupler.io. This integration solution can extract data from Excel automatically according to the schedule you set.

How do I extract data from Excel using power query? ›

Position the cursor on the Excel table, Select Data > Get & Transform Data > From Table/Range. Excel opens the Power Query Editor with your data displayed in a preview pane.

How do I extract a specific text in Power Automate? ›

How to Extract Text from Email Using Power Automate?
  1. Step 1: Create a New Flow. ...
  2. Step 2: Choose the Trigger. ...
  3. Step 3: Set up the Email Action. ...
  4. Step 4: Add a Compose Action. ...
  5. Step 5: Add a Parse JSON Action. ...
  6. Step 6: Add a Create File Action. ...
  7. Step 7: Save and Test the Flow.

What is the best AI tool for Excel spreadsheet? ›

Best Free AI Tool in Excel
AI ToolPricing
Power QueryIncluded with Excel and Power BI
Sheet+Free with in-app purchases
IdeasIncluded with Excel
New Data TypesIncluded with Excel
1 more row
2 days ago

What is the best AI tool for Excel? ›

What are Some of the Best AI Tools for Excel Users in 2024?
AI Excel ToolDescriptionLink
XLSTATXLSTAT comes with a Statistical analysis software add-in for Excel.XLSTAT
Data RobotMachine learning platform with Excel integrationData Robot
AlteryxBest for Data preparation and analytics platform with Excel integration.Alteryx
5 more rows
Feb 12, 2024

What is the best AI tool for Excel formulas? ›

Ajelix: Best AI Tool for Excel

This tool excels at swiftly translating text into Excel formulas, significantly reducing the time required.

How do I pull data from Azure? ›

Source
  1. On the lower ribbon of your KQL database, select Get Data. In the Get data window, the Source tab is selected.
  2. Select the data source from the available list. In this example, you're ingesting data from Azure storage.
Nov 16, 2023

How do I extract data from Azure database? ›

To export a database using the Azure portal, open the page for your database and select Export on the toolbar. Specify the BACPAC filename, select an existing Azure storage account and container for the export, and then provide the appropriate credentials for access to the source database.

How do I export Azure resources to Excel? ›

Go to the Azure portal:
  1. Go to the All resources page.
  2. Click the Export to CSV button.
  3. In the Export options dialog box, select the resources you want to export.
  4. Click Export.
Sep 22, 2023

What is the best way to extract data from Excel? ›

In order to extract data from Excel columns, you can use some combination of the VLOOKUP, MATCH, and INDEX functions. The VLOOKUP function is perhaps best equipped for data extraction, allowing you to look up and retrieve data from a specific column.

How to Automate Excel reports using Power Automate? ›

How to Set Up Power Automate in Excel
  1. Step 1: Create a Flow in Power Automate. To create a flow in Power Automate, follow these steps: ...
  2. Step 2: Choose the Trigger for the Flow. ...
  3. Step 3: Add Actions to the Flow. ...
  4. Step 4: Test and Save the Flow.

Can Power Automate read Excel data? ›

To read the content of a table from a local Excel file and iterate over its rows in Power Automate web, you can use the Read from Excel worksheet action. This action allows you to retrieve the value of a single cell or a data table.

Can you automate Excel with Power Automate? ›

Automate repetitive tasks: Power Automate can automate repetitive Excel tasks, saving time and reducing the risk of errors. Integrate with other apps: It allows seamless integration between Excel and other apps, enabling data transfer and updates across platforms.

Top Articles
Latest Posts
Article information

Author: Aron Pacocha

Last Updated:

Views: 6380

Rating: 4.8 / 5 (48 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Aron Pacocha

Birthday: 1999-08-12

Address: 3808 Moen Corner, Gorczanyport, FL 67364-2074

Phone: +393457723392

Job: Retail Consultant

Hobby: Jewelry making, Cooking, Gaming, Reading, Juggling, Cabaret, Origami

Introduction: My name is Aron Pacocha, I am a happy, tasty, innocent, proud, talented, courageous, magnificent person who loves writing and wants to share my knowledge and understanding with you.