Power Automate
SECTION 07 · LAB 7.1

Daily pending
requests report.

Read the current Excel data each day, keep pending requests, and email one useful summary.

Guided practice · Schedule, filter, shape & report

One report for all pending requests

Continue the purchase-request case, using a separate sample Excel workbook. Each day, read the saved rows, keep requests whose Status is Pending, and send one email containing a table.

Recurrence → List rows present in a table → Filter array → Select → Create HTML table → Send an email (V2)

This workbook is a separate data source

The SharePoint approval flow from Section 06 does not update this workbook automatically. In this lab, edit Status in the OneDrive workbook when testing changes. The report reads that workbook, not the SharePoint list.

STEP 01

Prepare the reporting workbook

  1. Select the training environment provided by your IT team. Use your assigned OneDrive for Business account and mailbox.
  2. Download PurchaseRequestsReporting.xlsx.
  3. Upload it to your Training folder in OneDrive for Business. Use the assigned folder if your organization provides a different location.
  4. Open the workbook and confirm the Requests sheet contains the PurchaseRequestsReporting table with 15 sample requests.

The columns include Request ID, Item name, Estimated cost, Business reason, Department, Status, and Request date. The sample contains 6 Pending, 6 Approve, and 3 Reject requests. Keep the earlier PurchaseRequests.xlsx file unchanged.

The separate reporting workbook is uploaded to the Training folder in OneDrive.
The separate reporting workbook is uploaded to the Training folder in OneDrive. · Select the image to enlarge.
STEP 02

Create a scheduled cloud flow

An instant flow starts when you run it manually. An automated flow reacts to an event. A scheduled cloud flow starts according to a recurrence schedule.

  1. Choose Create → Scheduled cloud flow.
  2. Name the flow What is Pending?, matching the trainer’s example.
  3. Set Repeat every: 1 Day and choose a suitable starting date and time.
  4. Create the flow and inspect its Recurrence trigger. Check the time zone and daily timing in its available parameters before relying on the schedule.
Choose Scheduled cloud flow to start the flow on a recurring schedule.
Choose Scheduled cloud flow to start the flow on a recurring schedule. · Select the image to enlarge.
Choose Day from the recurrence frequency options.
Choose Day from the recurrence frequency options. · Select the image to enlarge.
What is Pending? is configured to repeat every one day; the example starts at 10:00 AM.
What is Pending? is configured to repeat every one day; the example starts at 10:00 AM. · Select the image to enlarge.
Check the time zone

The creation screenshot does not show a time zone. Do not assume that 10:00 AM means Qatar local time. For a Qatar training schedule, select the recurrence time zone corresponding to UTC+03:00 Kuwait/Riyadh and verify the intended hour. Use a current or future start date appropriate to your exercise, rather than copying the screenshot’s historical date.

STEP 03

Read the current Excel table

  1. Add Excel Online (Business) → List rows present in a table.
  2. Set Location to OneDrive for Business and Document Library to OneDrive.
  3. Select your uploaded PurchaseRequestsReporting.xlsx file.
  4. Select the table PurchaseRequestsReporting.
Add List rows present in a table from Excel Online (Business).
Add List rows present in a table from Excel Online (Business). · Select the image to enlarge.
Select the reporting workbook and its PurchaseRequestsReporting table.
Select the reporting workbook and its PurchaseRequestsReporting table. · Select the image to enlarge.

The action returns a collection of rows called value or body/value. Each scheduled run reads the current saved OneDrive file again. Save and sync workbook edits before the next run; edits made after this action has read the file are for a later run.

STEP 04

Keep only Pending rows

  1. Add Data Operation → Filter array.
  2. In From, select value from List rows present in a table.
  3. In the left side of the filter, insert the row’s Status dynamic-content token. Do not type the word Status as ordinary text.
  4. Choose is equal to and enter Pending on the right.
The corrected filter compares the row’s Status dynamic-content token with the fixed text Pending.
The corrected filter compares the row’s Status dynamic-content token with the fixed text Pending. · Select the image to enlarge.

Filter array changes which rows remain. It keeps all fields of matching rows. With the unchanged sample workbook, 15 input rows become 6 output rows.

Use fx to confirm the data reference

A token’s label helps you recognize a field. Its underlying expression confirms where the value comes from. Click the filter’s left field and use fx to enter or check the current-row reference below. If your designer does not expose an existing token’s expression there, inspect the complete comparison through Edit in advanced mode or the action’s read-only Code view.

fx · Current row Status
item()?['Status']

In the fx editor, paste this expression without an @ prefix, then select Add or Update. Here item() means the row currently being evaluated by Filter array. The column key must match the Excel header.

ReferenceMeaning
'Status'Fixed text: the word Status
item()?['Status']The Status value from the current row
'Pending'The fixed value we want to match

If using Edit in advanced mode, the complete comparison is:

fx · Advanced-mode filter
@equals(item()?['Status'], 'Pending')

The @ prefix belongs to this complete advanced-mode expression. In the fx editor, enter equals(item()?['Status'], 'Pending') without the prefix if entering the whole comparison there. Use the screenshot’s basic comparison or the equivalent advanced expression; you do not need both.

STEP 05

Choose the report columns with Select

  1. Add Data Operation → Select.
  2. Set From to Body from Filter array, so only pending rows enter this action.
  3. In Map, type each report heading on the left. Insert the corresponding current-row value on the right, using dynamic content or fx.
Enter keyValue expression in fx
Request IDitem()?['Request ID']
Item nameitem()?['Item name']
Estimated costitem()?['Estimated cost']
Select maps the filtered rows into three report columns: Request ID, Item name, and Estimated cost.
Select maps the filtered rows into three report columns: Request ID, Item name, and Estimated cost. · Select the image to enlarge.

Use fx to confirm each reference: a heading on the left is a label you choose; the value on the right must read a field from the current filtered row. For example:

fx · Select Item name
item()?['Item name']

Select changes the shape of each row. It keeps 6 rows but reduces each to 3 report fields. It does not decide which requests are Pending—that was the filter’s job. Truncated tokens in the screenshot may show a preview of array data; confirm their source action rather than relying on the shortened text.

STEP 06

Turn the selected rows into an HTML table

  1. Add Data Operation → Create HTML table.
  2. Set From to Output from Select.
  3. Leave Columns as Automatic if shown. The Select keys become the table headings.
Create HTML table receives the array produced by Select.
Create HTML table receives the array produced by Select. · Select the image to enlarge.

This action converts the collection into one HTML table for the email body. No Apply to each is needed: Filter array and Select already work over collections, and the email will contain the whole table.

STEP 07

Send one summary email

  1. Add Office 365 Outlook → Send an email (V2).
  2. Set To to your own assigned training mailbox.
  3. Set Subject to Pending Orders, matching the screenshot.
  4. In Body, insert Output from Create HTML table. You may add a short introductory sentence before it.
  5. Save the flow.
The email body contains the HTML table output and the example subject is Pending Orders.
The email body contains the HTML table output and the example subject is Pending Orders. · Select the image to enlarge.

The screenshot uses the trainer’s recipient. Use your own training mailbox. Although the subject says Pending Orders, these records are the purchase requests used throughout the course.

STEP 08

Test now and verify the rows

  1. Use Test → Manually → Run flow to test without waiting for the next daily run. This does not change Recurrence into a manual trigger.
  2. Open the run details and inspect the inputs and outputs of each action.
  3. Confirm List rows returns 15 rows, Filter array returns 6 rows, and Select returns those 6 rows with 3 fields each.
  4. Check that one email arrives with the six requests below.
Request IDItem nameEstimated cost
PR001Monitor850
PR004Meeting room screen3000
PR006Laptop4500
PR008Desk950
PR011Scanner1000
PR014Tablet2200
The received Pending Orders email shows the six expected pending requests and three selected columns.
The received Pending Orders email shows the six expected pending requests and three selected columns. · Select the image to enlarge.
Test that the next run reads changed data

In the OneDrive workbook, change PR001 from Pending to Approve and wait for saving to finish. Run the flow again: expect 5 pending rows and no Monitor in the new email. Restore PR001 to Pending and save when finished. This is an additional learner check; it is not shown in the supplied result screenshot.

A successful run proves the test worked. To verify the actual daily schedule, leave the flow enabled and check a run started by Recurrence at the intended time. Turn it off after practice if you no longer want daily training emails.

If the email has no rows

Check the first action whose output becomes empty. An email can be delivered successfully even when the filter matched no rows.

Earlier incorrect configuration: Status was entered as ordinary text instead of a row-value token.
Earlier incorrect configuration: Status was entered as ordinary text instead of a row-value token. · Select the image to enlarge.

The earlier version generated @equals('Status','Pending'). Those two words differ, so every row was removed. Replace the left literal with item()?['Status'], as shown in the corrected screenshot.

Filter returns []
Inspect a List rows output row. Confirm the exact Status header and value, including spaces and capitalization. Use fx or advanced mode to confirm the left side reads the row value.
All 15 rows appear
Confirm Select reads Filter array Body and Create HTML table reads Select Output. Connecting the table directly to List rows bypasses the filter.
Wrong columns appear
Check Select’s mapping and the table’s input source. Use the three report keys and their current-row values.
Old statuses appear
Edit the selected OneDrive workbook, wait for saving to finish, and start a new run. Changes to SharePoint are not synchronized into this sample file.

This first version still sends an email when there are no pending rows. Skipping empty reports with a Condition and filtering directly in the Excel action are possible later improvements; neither is part of this lab.

SUCCESS CHECK

Explain the data at each step.

  • Recurrence starts the flow daily; List rows reads the saved workbook.
  • Filter array keeps Pending requests. Select chooses their report fields.
  • You can use fx to distinguish fixed text from a current-row reference.
  • Create HTML table turns the collection into one email table.
  • The unchanged sample produces one email with 6 requests and 3 columns.