Power Automate
SECTION 04 · LAB 4.1

Purchases from Excel

Read five purchase requests from an Excel table. Use a loop to send a separate email for each row.

Guided practice · Your first control

From one request to several

Our previous flows handled one request at a time. Now the workbook contains five requests. We want to repeat the same email action for each request, using that row’s details.

What is a control?

An email action does a task. A control organizes how actions run—for example, whether they repeat or which path they follow. Our first control is Apply to each.

A loop is a container for repeated work.

Apply to each receives a collection of items and runs the actions inside it once for each item. Each repetition is called an iteration. In this lab, one Excel row is one item.

APPLY TO EACH ROWSend an email using this row’s values
  • PR01 · MonitorMonitor email
  • PR02 · Office chairsOffice chairs email
  • …repeat for all five rowsFive emails in total

The current row is the row being processed in that iteration. The same email action uses a different item name, cost, and business reason as the loop moves through the rows.

WHAT YOU WILL BUILD

Read once. Repeat for each row.

Manually trigger a flow → List rows present in a table → Apply to each → Send an email (V2).

The Excel action reads the table once. The email action sits inside the loop and runs once per row.

Before you begin

Use the training environment assigned by your IT team. You need OneDrive for Business, permission to use the Excel Online (Business) connector, and an Outlook training mailbox.

The workbook contains five sample requests in a real Excel Table named PurchaseRequests. A worksheet and a table are different: the connector asks for the table name, not the worksheet name.

STEP 01

Upload the workbook to OneDrive

  1. Download PurchaseRequests.xlsx using the link above. Open it to review the five rows, then close it.
  2. Open OneDrive from the Microsoft 365 app launcher.
  3. Create or open a Training folder in My files.
  4. Select Create or upload → Files upload and upload the workbook.
  5. Confirm that PurchaseRequests.xlsx appears in the folder.

The file will be read from OneDrive for Business, not from its original location on your computer.

The practice workbook contains five purchase requests.
The practice workbook contains five purchase requests. · Select the image to enlarge.
Open OneDrive from the Microsoft 365 app launcher.
Open OneDrive from the Microsoft 365 app launcher. · Select the image to enlarge.
Choose Files upload.
Choose Files upload. · Select the image to enlarge.
PurchaseRequests.xlsx is stored in the Training folder.
PurchaseRequests.xlsx is stored in the Training folder. · Select the image to enlarge.
STEP 02

Create Purchases from Excel

  1. In Power Automate, select Create → Instant cloud flow.
  2. Name the flow Purchases from Excel.
  3. Select Manually trigger a flow and create the flow.

No manual inputs are needed. The data will come from the workbook.

Later screenshots show the earlier working name “email from excel.” Use Purchases from Excel throughout your lab.

Create an instant flow named Purchases from Excel.
Create an instant flow named Purchases from Excel. · Select the image to enlarge.
STEP 03

Read the rows from the Excel table

  1. Add an action below the trigger.
  2. Search for List rows present in a table and choose it under Excel Online (Business).
  3. Sign in with your training account if prompted.
  4. Set Location to OneDrive for Business.
  5. Set Document Library to OneDrive.
  6. Browse to /Training/PurchaseRequests.xlsx.
  7. Select the PurchaseRequests table.
The result is a collection

This action returns the table’s rows together. That collection is often called an array. We will give it to Apply to each so the flow can work on one row at a time.

Choose List rows present in a table under Excel Online (Business).
Choose List rows present in a table under Excel Online (Business). · Select the image to enlarge.
Choose OneDrive for Business as the location.
Choose OneDrive for Business as the location. · Select the image to enlarge.
Browse to the uploaded workbook in Training.
Browse to the uploaded workbook in Training. · Select the image to enlarge.
The action points to the PurchaseRequests table.
The action points to the PurchaseRequests table. · Select the image to enlarge.
STEP 04

Add the Apply to each control

  1. Add the next step below the Excel action.
  2. Search for Apply to each and select it under Control.
  3. In Select an output from previous steps, open dynamic content.
  4. Choose the row collection returned by List rows present in a table. In the screenshot it is labeled body/value; your designer may display value.

This tells the loop what to repeat over. Do not select a single column such as Item name as the loop’s collection.

Apply to each is found under Control.
Apply to each is found under Control. · Select the image to enlarge.
Give the loop the Excel action’s body/value row collection.
Give the loop the Excel action’s body/value row collection. · Select the image to enlarge.
STEP 05

Put the email action inside the loop

  1. Select the + inside the Apply to each container.
  2. Add Office 365 Outlook → Send an email (V2).
  3. Set To to your own training mailbox.
  4. Use the current Excel row’s Item name dynamic content as the subject.
  5. Build the body below using the matching Excel dynamic content tokens.

Select tokens from dynamic content rather than typing the bracketed names. Inside this loop, they refer to the row currently being processed.

Inside means repeated

An action inside Apply to each runs for every row. An action after the loop runs after the loop finishes. Check the container boundary in the full-flow screenshot.

The email subject and body use values from the current Excel row.
The email subject and body use values from the current Excel row. · Select the image to enlarge.
Send an email (V2) is inside Apply to each; the Excel action is outside it.
Send an email (V2) is inside Apply to each; the Excel action is outside it. · Select the image to enlarge.
STEP 06

Save and run the flow

  1. Select Save and correct any configuration errors.
  2. Select Test → Manually → Test.
  3. Check that both Excel Online (Business) and Office 365 Outlook connections are ready, then select Continue.
  4. Select Run flow on the next panel.
Each run processes the rows again

With five data rows and one email action inside the loop, expect five emails per run. Running the flow again sends another set; this lab does not mark rows as already processed.

Confirm the Excel and Outlook connections before continuing to run the flow.
Confirm the Excel and Outlook connections before continuing to run the flow. · Select the image to enlarge.
STEP 07

Inspect the five iterations and the emails

Open the completed run and expand Apply to each. The screenshot shows 1 of 5: you are viewing the first of five iterations in one flow run. Use the arrows to inspect the other iterations and expand their email actions to compare the values.

Check your Outlook training mailbox for five emails, with subjects corresponding to Monitor, Office chairs, Keyboard, Meeting room screen, and Headset. Open individual messages to verify their costs and reasons. The mailbox screenshot below shows part of the received set.

The successful run shows five iterations, with the first iteration selected.
The successful run shows five iterations, with the first iteration selected. · Select the image to enlarge.
Separate emails use the item names and details from different Excel rows.
Separate emails use the item names and details from different Excel rows. · Select the image to enlarge.
SUCCESS CHECK

One flow run. Five repetitions.

  • The Excel action reads the PurchaseRequests table.
  • Apply to each receives the collection of rows.
  • The email action is inside the loop and uses the current row.
  • The completed run has five iterations and produces five emails.

Think about it: if the table had seven data rows, how many times would this email action run? Seven—once for each row.

If something does not work

No table
Check that the workbook contains an Excel Table named PurchaseRequests and that you selected the correct file. A formatted cell range alone is not enough.
Wrong count
Check the table’s data rows and the Excel action output. Blank rows included in the table can also be returned.
Extra loop
Check the full structure: one Apply to each around one email action. If the designer adds another loop, review which collection or dynamic value you selected.
Same details
Make sure the email uses Excel row tokens, rather than the fixed text or manual-trigger inputs from an earlier lab.
Next: should every row receive the same treatment?

A loop repeats the work. A condition can decide what should happen for a particular row—for example, whether its estimated cost is greater than 1000.