Power Automate
SECTION 07 · LAB 7.2

Filter directly
in Excel.

Simplify the daily report by asking the Excel action to return only Pending requests.

Guided practice · Excel Filter Query & date challenge

Same requests, fewer actions

In Lab 7.1, List rows returned the table rows and Filter array kept the Pending requests afterward. Now use Filter Query inside List rows present in a table to return only matching rows to the remaining actions.

Lab 7.1Lab 7.2
List rows → Filter array → SelectList rows with Filter Query → Select
15 rows returned, then reduced to 66 matching rows returned by the Excel action

Keep the same OneDrive reporting workbook and daily Recurrence. This is still a report of Excel data; it does not synchronize with the SharePoint approval flow.

STEP 01

Preserve the working report

  1. Use your assigned training environment, OneDrive workbook, and mailbox.
  2. Use Save As to copy the working What is Pending? flow. Give the copy a descriptive name, such as What is Pending? — Excel filter.
  3. Open the copy for editing. Keep the original for comparison.
  4. Enable the copy after saving when ready to test. Keep only the intended version enabled for daily use to avoid duplicate scheduled emails.

The screenshots show the existing report being simplified; the copy operation itself is not pictured. The Excel action is labeled List rows present in a table 1 in these screenshots. Your action name may differ.

STEP 02

Filter in the Excel action

  1. Open List rows present in a table.
  2. Keep the reporting workbook and PurchaseRequestsReporting table selected.
  3. Under Advanced parameters, expose Filter Query.
  4. Enter the query below as ordinary text in that setting, then save.
fx · Excel Filter Query
Status eq 'Pending'

This is an OData filter query, not an fx expression. Paste it into Filter Query directly, without an @ prefix or an equals function. Status is the column, eq means equal, and 'Pending' is the text value to match.

The Excel action’s Filter Query is set to Status eq 'Pending'.
The Excel action’s Filter Query is set to Status eq 'Pending'. · Select the image to enlarge.

The screenshot shows stored identifiers for some source fields. Use your own connection and workbook/table selections; do not copy the displayed identifiers.

STEP 03

Remove Filter array and reconnect Select

  1. On Filter array, open the action menu and select Delete.
  2. Confirm removal of that action.
  3. Open Select. Remove its old reference to Filter array from From.
  4. Insert value or body/value from the Excel List rows action.
  5. Keep Create HTML table connected to Select Output and the email body connected to Create HTML table Output.
Delete the separate Filter array action after configuring the Excel Filter Query.
Delete the separate Filter array action after configuring the Excel Filter Query. · Select the image to enlarge.
Confirm removal of Filter array.
Confirm removal of Filter array. · Select the image to enlarge.
Follow the source of each token

Deleting an action does not make its old references valid. Check Select’s From field explicitly. The filtered collection now comes from List rows. As in Lab 7.1, use fx or read-only Code view to confirm a reference when its shortened label is unclear.

The supplied screenshots do not show Select’s updated From field. Perform this reconnection in your flow before testing.

STEP 04

Include department and date in the report

Match the four report columns in this lab’s result. In Select, use these headings and current-row value expressions:

Report headingValue
Request IDThe current row’s Request ID dynamic value
Estimated costitem()?['Estimated cost']
Departmentitem()?['Department']
Request dateitem()?['Request date'] initially

Use fx for the expressions in the value fields. For Request ID, confirm the actual field key from your Excel output if entering an expression: the original workbook header is Request ID, but a renamed header may produce a different key. Item name is omitted from this version of the report.

Save and test manually without waiting for the next scheduled run. With the unchanged sample data, the Excel action should return 6 rows. Select should also return 6 rows, now with 4 fields each.

The simplified flow succeeds with Recurrence, List rows, Select, Create HTML table, and one email action.
The simplified flow succeeds with Recurrence, List rows, Select, Create HTML table, and one email action. · Select the image to enlarge.

The successful run shows the flow no longer needs a separate Filter array. No Apply to each is needed to send the single summary email.

CHALLENGE · REUSE WHAT YOU KNOW

Make the request date readable.

The first email below shows dates as numbers such as 46328. Improve Request date so it displays as 02/11/2026. Keep all six pending requests and the other report columns unchanged.

  • Inspect what type of value Excel returns for Request date.
  • Reuse formatDateTime from the earlier expressions lab.
  • Check the Excel action’s advanced settings if the expression reports an invalid date.
  • Save, rerun, and compare the new email with the earlier result.
Before the date fix: the email has the six pending requests, but Request date contains Excel serial numbers.
Before the date fix: the email has the six pending requests, but Request date contains Excel serial numbers. · Select the image to enlarge.
Show the date challenge solution

Return a date string, then format it

An Excel serial such as 46328 is a count of days, not an ISO date string. Converting it with float() does not make it a date that formatDateTime() can parse.

  1. Open the existing List rows present in a table action.
  2. Under Parameters → Advanced parameters, select Show all or expose DateTime Format.
  3. Set DateTime Format to ISO 8601. Keep Filter Query unchanged.
  4. In Select, replace the Request date value with the final expression below through fx.
  5. Save and start a new test run so the Excel action reads the dates using its updated setting.
The existing Excel action has Filter Query enabled and DateTime Format set to ISO 8601.
The existing Excel action has Filter Query enabled and DateTime Format set to ISO 8601. · Select the image to enlarge.
fx · Readable request date
formatDateTime(item()?['Request date'], 'dd/MM/yyyy')

In fx, paste the expression without an @ prefix. item()?['Request date'] reads the current row’s date; 'dd/MM/yyyy' chooses day/month/year. Uppercase MM means month. This formats the date and does not perform a time-zone conversion.

After the fix: the same six pending requests display readable dates in day/month/year format.
After the fix: the same six pending requests display readable dates in day/month/year format. · Select the image to enlarge.

Expected dates: PR001 02/11/2026; PR004 05/11/2026; PR006 09/11/2026; PR008 11/11/2026; PR011 16/11/2026; PR014 23/11/2026. These expectations assume the original sample workbook is unchanged.

If something does not work

Missing action reference
Remove Select’s old Filter array input and choose value from the current Excel action. Action names can differ between flows.
No matching rows
Confirm the selected file/table and actual Status values. Use the query exactly as shown, with single quotes around Pending.
All rows in email
Confirm the Filter Query is saved on the Excel action supplying Select. Inspect that action’s latest run output.
Invalid date in Select
Check the date challenge solution. The new run must return ISO dates before the final formatDateTime expression can parse them.
SUCCESS CHECK

Explain where the filtering happens.

  • The Excel action returns only Pending requests.
  • Filter array is removed and Select reads the Excel action’s value collection.
  • One email contains six pending requests when the sample data is unchanged.
  • The report includes Request ID, Estimated cost, Department, and readable Request date.
  • You can distinguish the OData Filter Query from an fx expression.

This version still sends an email when no requests match. A Condition to skip empty reports can be added in a later exercise.