Skip to content
Power Automate

Building a Planner Overdue and Upcoming Task Digest in Power Automate: Resolving Assignee Names and Designing an Outlook-Safe HTML Email

Extending a scheduled Planner reminder flow with real assignee names, summary cards, due-date badges and a responsive HTML dashboard, without changing its existing logic.

Rajiv KumarNovember 26, 202651 min read
Building a Planner Overdue and Upcoming Task Digest in Power Automate: Resolving Assignee Names and Designing an Outlook-Safe HTML Email

Microsoft Planner returns assignees as user IDs, so a basic Power Automate reminder cannot say who owns each task. This walkthrough documents how I extended an existing scheduled flow: one Office 365 Groups lookup per run to resolve display names, Filter array and Select patterns for multiple and comma-containing names, summary metrics, due-today/tomorrow badges, and an Outlook-safe, mobile-friendly HTML email, deployed as an in-place package update.

Note

A note on identifiers and sample data. Tenant, group and plan IDs are shown as <your-tenant-id>, <your-group-id> and <your-plan-id>. All people, email addresses (@contoso.com), bucket names and task titles in examples and screenshots are fictitious sample data. The cast used throughout is Ravi Rajan, Ankiet Mishra, Aman Gupta, Harsh Ananad, Janhvi Mishra, Ranjeet Singh, Atul Sinha, Md Imran and Humraj Srivastav. Apart from those substitutions, every expression, action name and HTML fragment in this article is copied from the final deployed flow definition. The logic is unchanged.


1. Introduction

Most teams that run work through Microsoft Planner reach the same point sooner or later. The board is the single source of truth, but nobody opens it every morning to check which cards slipped past their due date or which ones land this week. The team lead ends up scrolling through buckets, filtering by due date and then chasing people over chat. It works while the plan is small. It stops working once a plan holds a couple of hundred tasks across a dozen buckets.

The team I was working with had already automated part of this. A scheduled Power Automate flow called Test - ProdNotify: Upcoming & Overdue Planner Tasks ran every weekday morning. It read the plan, filtered overdue tasks and tasks due in the next seven days, and emailed two plain HTML tables to the team lead. The logic was sound, and the schedule, filters and three subject-line branches had been in use for a while.

The email itself was the weak point. It looked like this:

  • A plain <p> paragraph with "# Please review the Planner tasks that are overdue or still open:-" as a heading.

  • Two tables produced by the Create HTML table action, styled with a <style> block (which Outlook partly ignores).

  • Three columns only: Bucket Name, Task Name and Overdue Date / Due Date.

  • No indication of who owned each task.

That last point was the real problem. A reminder email exists to trigger a follow-up conversation, and you cannot follow up on a task without knowing who it belongs to. The reader had to open Planner for every row to find the assignee, which defeated the purpose of sending the email.

Planner does not make this easy. Its connector returns assignees as Azure AD (Entra ID) user object IDs, not names. So "add an Assigned To column" turned into a small identity-resolution problem inside the flow.

The requirements for the redesign were:

  1. Add an Assigned To column with real display names, including tasks with several assignees.

  2. Present the email as a readable dashboard: header, greeting, summary cards, two styled tables, an action panel and a button that opens the Planner board.

  3. Add summary metrics: overdue, upcoming (next 7 days), total open tasks and tasks completed in the last 7 days.

  4. Keep the trigger, schedule, Planner IDs, filter expressions, counts, conditions, subjects, recipients and importance exactly as they were.

  5. Deploy the change as an update to the existing flow, so the flow ID, run history and ownership stay the same.

The rest of this article documents how I did it, why I made each decision, what broke during testing and how I fixed it.


2. What We Are Building

The finished solution is still the same scheduled cloud flow. It has gained an identity-lookup step, two summary filters, a row-rendering stage and a single shared HTML composition used by all three email branches.

At a high level:

  1. Recurrence trigger runs Monday to Friday at 09:15 (Arabian Standard Time).

  2. Planner: List buckets and Planner: List tasks read the plan once.

  3. Office 365 Groups: List group members reads the plan's Microsoft 365 group members once (new).

  4. Filter array actions split tasks into overdue and due in the next 7 days (unchanged).

  5. Two Apply to each loops resolve each task's bucket name and assignee names, then append a row object to the TasksArray / TasksArray2 variables.

  6. Overdue_Count and Upcoming_Count compose the counts (unchanged), and two new filters compute Total Open and Completed (Last 7 Days).

  7. Two Select actions convert each array into styled <tr> rows (new).

  8. Compose Email HTML assembles the full dashboard (new).

  9. Condition 3 → Both Exist → Only Overdue Check picks one of the three existing Send an email (V2) actions, which now all send Compose Email HTML.

  10. Terminate ends the run as Succeeded.

flowchart TD
    A[Recurrence<br/>Mon to Fri 09:15 AST] --> B[List buckets<br/>Planner]
    B --> C[List tasks<br/>Planner]
    C --> D[List group members<br/>Office 365 Groups, new]
    D -->|Succeeded, Failed,<br/>TimedOut or Skipped| E[Compose Table CSS]
    E --> F[Filter array<br/>Overdue]
    F --> G[Filter array 2<br/>Due in next 7 days]
    G --> H[Apply to each / Apply to each 2<br/>legacy, no effect on output]
    H --> I[Initialize TasksArray<br/>Initialize TasksArray2]
    I --> J[Apply to each FilteredTasks<br/>bucket + assignees + append]
    J --> K[Apply to each FilteredTasks 2<br/>bucket + assignees + append]
    K --> L[Create HTML table x2<br/>legacy, no longer emailed]
    L --> M[Overdue_Count / Upcoming_Count]
    M --> N[Filter array Open tasks<br/>Filter array Completed last 7 days]
    N --> O[Select Overdue Rows<br/>Select Upcoming Rows]
    O --> P[Compose Email HTML]
    P --> Q{Condition 3<br/>overdue OR upcoming > 0}
    Q -->|Yes| R{Both Exist}
    R -->|Yes| S1[Send an email V2<br/>Upcoming & Overdue]
    R -->|No| T{Only Overdue Check}
    T -->|Yes| S2[Send an email V2 1<br/>Overdue]
    T -->|No| S3[Send an email V2 3<br/>Upcoming]
    Q -->|No| U[Compose 1<br/>There is No task]
    S1 --> V[Terminate: Succeeded]
    S2 --> V
    S3 --> V
    U --> V

The diagram reflects the actual runAfter chain in the deployed definition. The final flow has 44 actions (the original had 32). I added 12 and modified 6 directly, and the two parent loops and the condition containers count as changed because their children changed. Nothing was removed.


3. Final Email Design and Features

Before writing any expressions I looked at the existing email and a dashboard mock-up the team had shared as a reference ("Planner Task Review Dashboard"). The mock-up showed the target layout: a branded header, four KPI cards, two tables with an Assigned To column, an action panel with a Planner button and a footer. I kept that structure and adapted it to what email clients can actually render.

Before vs. after. The original Outlook message was a plain paragraph with two grey Create HTML table grids of three columns each. The final message is the dashboard described below. The screenshots of the email in this article were produced by rendering the deployed template and row expressions with the fictitious sample dataset below, because the real messages contain colleagues' names and internal task titles. The layout, colours and badges are exactly what the flow produces.

The sample dataset used for the screenshots and examples (the day of the run is taken as 25-Nov-2026):

Table

Bucket

Task

Assigned To

Date

Overdue

Collaboration Platforms

Quarterly Licence Review

Ravi Rajan, Ankiet Mishra, Consultant

24-Nov-2026

Upcoming

Digital Workplace

Intranet Navigation Refresh

Aman Gupta

25-Nov-2026 (Due today)

Upcoming

Collaboration Platforms

Vendor Onboarding Portal

Harsh Ananad, Consultant

26-Nov-2026 (Due tomorrow)

Upcoming

Service Desk

Knowledge Base Clean-up

Janhvi Mishra, Ranjeet Singh

27-Nov-2026 (In 2 days)

Upcoming

Data & Reporting

Monthly KPI Dashboard

Atul Sinha

29-Nov-2026

Upcoming

Security & Compliance

Access Review Q4

Md Imran, Humraj Srivastav

30-Nov-2026

Upcoming

Digital Workplace

Teams Governance Policy

(none) → Unassigned

01-Dec-2026

Before: the original notification, rendered with the same sample data.

After: the redesigned dashboard email, desktop width.

The email is built top to bottom from these sections. Each is marked with an HTML comment in the template (SECTION A to SECTION G).

Section

What it shows

Why it is there

A. Header

Dark navy band (#0B2A5B) with a calendar icon tile, the title "Action Required: Review Upcoming & Overdue Planner Tasks", subtitle "Microsoft Planner – Task Review & Follow-Up" and a green "P / Microsoft Planner" badge on the right

Recognisable at a glance in a crowded inbox, and it repeats the subject's call to action

B. Greeting

"Hi Ravi," and one sentence of instruction

Kept from the original email so the tone did not change for the recipient

C. Summary cards

Four cards: Overdue Tasks, Upcoming Tasks (Next 7 Days), Total Open Tasks, Completed (Last 7 Days)

Gives the reader the scale of the problem before they read any rows

D. Overdue table

Red-tinted section header, navy column headers, columns No. / Bucket Name / Task Name / Assigned To / Overdue Date

The rows that need action today

E. Upcoming table

Blue-tinted section header, same columns with Due Date

The rows that need attention this week

Assigned To chips

Each person rendered as a separate pill (#EEF2FA background)

Several owners stay visually distinct, and names that contain commas are not broken apart

Date badges

Overdue dates in red on a pink cell. Upcoming dates within 2 days on an amber cell with a "Due today", "Due tomorrow" or "In 2 days" badge

Draws attention to the rows that matter most

F. Action Requested

Three bullet instructions on the left, Open in Microsoft Planner ↗ button on the right

Turns the email into something the reader acts on

G. Footer

"Regards, MS Planner" and an italic automated-reminder disclaimer

Same sign-off as the original, and makes clear the message is automated

A few design decisions are worth explaining:

  • One template for all three branches. The original flow had three hand-written bodies, one per scenario. I replaced them with a single Compose Email HTML output. Each table section renders an "empty state" card ("No overdue tasks" / "No tasks due in the next 7 days") when its array is empty, so the same HTML is correct in every branch. Only the subject still differs per branch.

  • Real tables for task data. Task lists are tabular. Every email client handles <table> reliably, and Outlook desktop handles almost nothing else reliably.

  • Restrained colour. Red is reserved for overdue, amber for "due within 2 days" and blue/navy for structure. The reader should be able to scan the right-hand date column and see where to look.

  • A maximum width of 1040 px. A five-column table with long task titles needs width. The mock-up was wide, and Outlook's reading pane on a desktop monitor comfortably displays 1040 px.


4. Prerequisites and Required Permissions

Everything in this solution uses standard connectors. No premium licence is needed for the connectors involved.

Connector

API name in definition

Operations used

Tier

Planner

shared_planner

ListBuckets_V3, ListTasks_V3

Standard

Office 365 Groups

shared_office365groups

ListGroupMembers

Standard

Office 365 Outlook

shared_office365

SendEmailV2

Standard

What you need:

  1. A Microsoft 365 account with Power Automate. The flow is a scheduled cloud flow, and in my environment its details page reports "This flow runs on owner's plan".

  2. Access to the Planner plan. The account behind the Planner connection must be a member of the Microsoft 365 group that owns the plan, otherwise List buckets and List tasks cannot read it.

  3. An Office 365 Groups connection that can read the same group's members. List group members is called with the same group ID as the Planner actions. In my case the same service account that owned the Planner and Outlook connections was a member of the group, and the call succeeded on the first run without any extra consent or admin action. I am not claiming a specific directory permission beyond that, because I did not need one. If your connection account cannot see the group's membership, the action fails. The flow is built to survive that failure (see section 16).

  4. An Outlook connection for the sending mailbox. Send an email (V2) sends as the connection's account. In my tests the messages appeared in that service mailbox's Sent Items.

  5. Flow ownership or co-ownership, so you can export a package, import it with Update and turn the flow back on afterwards.

All three connections already existed in the environment for the same service account. The Groups connection was the only new connection reference in the package, and at import time I mapped it to the existing Office 365 Groups connection for that account.


5. Understanding the Existing Planner Data

Two Planner calls feed the whole flow. Both take the Group Id (the Microsoft 365 group that owns the plan) and the Plan Id:

"parameters": {
  "groupId": "<your-group-id>",
  "id": "<your-plan-id>"
}

Buckets

List buckets returns the plan's buckets. The flow uses only id and name, to turn a task's bucketId into a readable bucket name. A representative item (placeholder values):

{
  "id": "<bucket-id>",
  "name": "Digital Workplace",
  "planId": "<your-plan-id>",
  "orderHint": "..."
}

Tasks

List tasks returns the tasks under body/value. These are the fields the flow reads:

Field

Used for

id

Task identity (not shown in the email)

bucketId

Joined to List buckets to get Bucket Name

title

Task Name

dueDateTime

Overdue / upcoming filters, Overdue Date / Due Date

percentComplete

100 = completed. Anything less is open

completedDateTime

Completed (Last 7 Days) card

assignments

Object keyed by assignee user ID. Used to match group members

_assignments

Array form of the same assignments. Used to count assignees

A representative task, trimmed to the relevant fields (values are placeholders):

{
  "id": "<task-id>",
  "planId": "<your-plan-id>",
  "bucketId": "<bucket-id>",
  "title": "Vendor Onboarding Portal",
  "percentComplete": 50,
  "dueDateTime": "2026-11-26T...Z",
  "completedDateTime": null,
  "assignments": {
    "<user-object-id-1>": { "...": "..." },
    "<user-object-id-2>": { "...": "..." }
  },
  "_assignments": [
    { "userId": "<user-object-id-1>", "...": "..." },
    { "userId": "<user-object-id-2>", "...": "..." }
  ]
}

The exact inner properties of each assignment entry (assigned-by, order hint and so on) are not used by this flow and are shown as "...". What matters is that assignments is an object whose keys are user IDs and _assignments is an array with one entry per assignee.

Why Planner gives you IDs, not names

Planner stores assignments as references to directory users. A task has no "display name" field for its assignees. The name lives in Entra ID and can change at any time (marriage, title suffixes like ", Consultant" and so on). Planner returns the stable object ID and leaves name resolution to the caller.

That means you cannot drop assignments into an email. You would get either [object Object] or a list of GUIDs. The flow has to look the IDs up somewhere, and the obvious place is the Microsoft 365 group that owns the plan: everyone who can be assigned a task in a group plan is normally a member of that group.

On the real data in my test run, every completed task (158 of them) had completedDateTime populated. I checked this before building the "Completed (Last 7 Days)" card on that field.


6. Power Automate Flow Architecture

The table below lists every action in the final definition, in execution order, with its connector and whether I changed it. The action names are the internal names from the definition. In the designer they show with spaces instead of underscores (for example Filter_array_(Lookup_assignees) appears as Filter array (Lookup assignees)).

The top of the flow in the classic designer. *List group members sits between List tasks and Compose Table CSS, and the ⓘ icon under it marks the custom run-after setting on Compose Table CSS. The environment name is masked.*

#

Action (internal name)

Type / Connector

Runs after

Status

0

Recurrence

Trigger

n/a

Unchanged

1

List_buckets

Planner ListBuckets_V3

trigger

Unchanged

2

List_tasks

Planner ListTasks_V3

List_buckets

Unchanged

3

List_group_members

Office 365 Groups ListGroupMembers

List_tasks

Added

4

Compose_Table_CSS

Compose

List_group_members (Succeeded/Failed/TimedOut/Skipped)

runAfter modified

5

Filter_array

Filter array

Compose_Table_CSS

Unchanged

6

Filter_array_2

Filter array

Filter_array

Unchanged

7

Apply_to_each (→ Condition → Compose)

Apply to each

Filter_array_2

Unchanged (legacy)

8

Apply_to_each_2 (→ Condition_2)

Apply to each

Apply_to_each

Unchanged (legacy)

9

Initialize_variable (TasksArray)

Initialize variable

Apply_to_each_2

Unchanged

10

Initialize_variable_2 (TasksArray2)

Initialize variable

Initialize_variable

Unchanged

11

Apply_to_each_FilteredTasks

Apply to each over Filter_array

Initialize_variable_2

Modified (children)

11a

Filter_array_(Lookup_bucket)

Filter array

loop start

Unchanged

11b

Compose_BucketName

Compose

11a

Unchanged

11c

Filter_array_(Lookup_assignees)

Filter array

11b

Added

11d

Select_assignee_names

Select

11c

Added

11e

Compose_AssignedTo

Compose

11d

Added

11f

Append_to_array_variable_2 (→ TasksArray)

Append to array variable

11e

Modified

12

Apply_to_each_FilteredTasks_2

Apply to each over Filter_array_2

11

Modified (children)

12a

Filter_array_(Lookup_bucket)_2

Filter array

loop start

Unchanged

12b

Compose_BucketName_2

Compose

12a

Unchanged

12c

Filter_array_(Lookup_assignees)_2

Filter array

12b

Added

12d

Select_assignee_names_2

Select

12c

Added

12e

Compose_AssignedTo_2

Compose

12d

Added

12f

Append_to_array_variable (→ TasksArray2)

Append to array variable

12e

Modified

13

Create_HTML_table

Create HTML table

12

Unchanged (legacy)

14

Create_HTML_table_2

Create HTML table

13

Unchanged (legacy)

15

Overdue_Count

Compose

14

Unchanged

16

Upcoming_Count

Compose

15

Unchanged

17

Filter_array_(Open_tasks)

Filter array

16

Added

18

Filter_array_(Completed_last_7_days)

Filter array

17

Added

19

Select_Overdue_Rows

Select

18

Added

20

Select_Upcoming_Rows

Select

19

Added

21

Compose_Email_HTML

Compose

20

Added

22

Condition_3

Condition

21 (was 16)

runAfter modified

22a

Both_Exist

Condition

inside 22 (yes)

Unchanged

22b

Send_an_email_(V2)

Office 365 Outlook SendEmailV2

inside 22a (yes)

Body modified

22c

Only_Overdue_Check

Condition

inside 22a (no)

Unchanged

22d

Send_an_email_(V2)_1

Office 365 Outlook

inside 22c (yes)

Body modified

22e

Send_an_email_(V2)_3

Office 365 Outlook

inside 22c (no)

Body modified

22f

Compose_1

Compose

inside 22 (no)

Unchanged

23

Terminate

Terminate

22

Unchanged

A few architectural choices are worth calling out before the step-by-step section.

I added steps, I did not rewrite the flow. The existing filters and loops encoded rules the team had agreed on, such as "overdue means due before now and not 100% complete". I had no reason to re-derive them, and rewriting them would have widened the risk of the change. I inserted new actions into the existing runAfter chain and changed only the email bodies.

I left the legacy actions in place. Apply_to_each, Apply_to_each_2, Compose_Table_CSS, Create_HTML_table and Create_HTML_table_2 no longer contribute to the email. The two bucket loops iterate over buckets and test a dueDateTime property that buckets do not have, so they do nothing useful. I kept them anyway, because the brief was to change the email, not to clean up the flow. They also cost almost nothing (two seconds each in the run view). Removing them is a safe follow-up once the new version has been in production for a while.

One member lookup per run. List_group_members sits outside both loops and runs once. Everything inside the loops is in-memory array work (see section 8).

One HTML composition, three senders. Compose_Email_HTML runs before Condition_3, so whichever branch fires sends the same body.


7. Step-by-Step Flow Implementation

This section walks through the flow in execution order. Sections 8 to 13 go deeper on the assignee logic, the two task pipelines, the summary cards and the HTML.

Step 1: Recurrence trigger (unchanged)

  • Connector: built-in Schedule

  • Purpose: run the review every working morning before the team's day starts.

"Recurrence": {
  "type": "Recurrence",
  "recurrence": {
    "frequency": "Week",
    "interval": 1,
    "timeZone": "Arabian Standard Time",
    "startTime": "2025-12-02T09:15:00Z",
    "schedule": {
      "weekDays": ["Monday", "Wednesday", "Friday", "Tuesday", "Thursday"],
      "hours": ["9"],
      "minutes": [15]
    }
  }
}

The order of weekDays is exactly as stored by the designer. Order does not matter to the scheduler. Because timeZone is set, the 09:15 is local time, not UTC.

Step 2: List buckets (unchanged)

  • Connector: Planner, operation ListBuckets_V3

  • Inputs: Group Id = <your-group-id>, Plan Id = <your-plan-id>

  • Output used: outputs('List_buckets')?['body/value'], the array of { id, name, ... }

  • Why it runs first: the task loops look up bucket names from this array instead of calling Planner per task.

Step 3: List tasks (unchanged)

  • Connector: Planner, operation ListTasks_V3

  • Inputs: same Group Id and Plan Id

  • Runs after: List_buckets

  • Output used: outputs('List_tasks')?['body/value'], every task in the plan, open and completed. Four filters later read from this one array.

Step 4: List group members (new)

  • Connector: Office 365 Groups, operation ListGroupMembers

  • Runs after: List_tasks (Succeeded)

  • Purpose: load the id and displayName of every member of the plan's Microsoft 365 group, once, so the loops can map assignee IDs to names.

"List_group_members": {
  "type": "OpenApiConnection",
  "runAfter": { "List_tasks": ["Succeeded"] },
  "inputs": {
    "host": {
      "apiId": "/providers/Microsoft.PowerApps/apis/shared_office365groups",
      "connectionName": "shared_office365groups",
      "operationId": "ListGroupMembers"
    },
    "parameters": {
      "groupId": "<your-group-id>",
      "$top": 999
    },
    "authentication": "@parameters('$authentication')"
  }
}

In the designer this is Office 365 Groups → List group members, with Group Id set to the same value used by the Planner actions and Top set to 999 under advanced parameters. Without $top the connector returns a smaller default page, and a larger group would show some assignees as "User details unavailable".

List group members with advanced options expanded. The Group Id has been replaced with zeros for this screenshot.

The output (body('List_group_members')?['value']) is an array of user objects. The flow uses id and displayName:

{
  "value": [
    { "id": "<user-object-id-1>", "displayName": "Ravi Rajan", "...": "..." },
    { "id": "<user-object-id-2>", "displayName": "Ankiet Mishra, Consultant", "...": "..." }
  ]
}

Step 5: Compose Table CSS (runAfter changed)

This is the legacy <style> block used by the old email body. Its content is unchanged. I changed only its Configure run after setting:

"Compose_Table_CSS": {
  "type": "Compose",
  "runAfter": {
    "List_group_members": ["Succeeded", "Failed", "TimedOut", "Skipped"]
  },
  "inputs": "<style>\ntable {\n  border: 1px solid #1C6EA4;\n ... (legacy CSS, unchanged) ...\n</style>"
}

This is the only error-handling change in the flow, and it matters. Previously the action ran after List_tasks. Now it waits for List_group_members, but runs whether that call succeeds or not. If the Groups connector fails one morning (an expired connection, a throttling timeout), the rest of the flow still runs and the email still goes out. Rows simply show "User details unavailable" instead of names. A reminder with missing names is far more useful than no reminder.

Step 6: Filter array, overdue tasks (unchanged)

"Filter_array": {
  "type": "Query",
  "inputs": {
    "from": "@outputs('List_tasks')?['body/value']",
    "where": "@and(\r\n  not(empty(item()?['dueDateTime'])),\r\n  less(item()?['dueDateTime'], utcNow()),\r\n  less(item()?['percentComplete'], 100)\r\n)"
  }
}

A task is overdue when it has a due date, the due date is before now (UTC) and it is not 100% complete. dueDateTime is an ISO 8601 UTC string, so the less() string comparison against utcNow() sorts correctly.

Step 7: Filter array 2, upcoming tasks (unchanged)

"Filter_array_2": {
  "type": "Query",
  "inputs": {
    "from": "@outputs('List_tasks')?['body/value']",
    "where": "@and(\n  not(empty(item()?['dueDateTime'])),\n  greaterOrEquals(item()?['dueDateTime'], utcNow()),\n  lessOrEquals(item()?['dueDateTime'], addDays(utcNow(), 7)),\n  less(item()?['percentComplete'], 100)\n)\n"
  }
}

Upcoming means due between now and now + 7 days, inclusive, and not complete. The two filters are mutually exclusive at the utcNow() boundary, so no task appears in both tables.

Step 8: Apply to each / Apply to each 2 (legacy, unchanged)

Both loops iterate over outputs('List_buckets')?['body/value'] and contain conditions that test item()?['dueDateTime']. Buckets have no due date, so the conditions never do useful work. Apply_to_each → Condition → yes branch holds a Compose with the text "No tasks due in next 7 days", and Condition_2 has no actions. I left them untouched, as explained in section 6.

Step 9: Initialize variable / Initialize variable 2 (unchanged)

"Initialize_variable":   { "inputs": { "variables": [ { "name": "TasksArray",  "type": "array", "value": [] } ] } },
"Initialize_variable_2": { "inputs": { "variables": [ { "name": "TasksArray2", "type": "array", "value": [] } ] } }

TasksArray collects overdue rows and TasksArray2 collects upcoming rows. Power Automate requires variables to be initialized at the top level, outside any loop, which is why these sit before the loops.

Step 10: Apply to each FilteredTasks, the overdue loop (modified)

  • Iterates over: @body('Filter_array')

  • Contains (in order): Filter_array_(Lookup_bucket) → Compose_BucketName → Filter_array_(Lookup_assignees) → Select_assignee_names → Compose_AssignedTo → Append_to_array_variable_2

The bucket lookup is unchanged:

"Filter_array_(Lookup_bucket)": {
  "type": "Query",
  "inputs": {
    "from": "@outputs('List_buckets')?['body/value']",
    "where": "@equals(item()?['id'], items('Apply_to_each_FilteredTasks')?['bucketId'])"
  }
},
"Compose_BucketName": {
  "type": "Compose",
  "inputs": "@coalesce(first(body('Filter_array_(Lookup_bucket)'))?['name'], 'Unknown Bucket')"
}

Inside a Filter array, item() refers to the element being filtered (a bucket), and items('Apply_to_each_FilteredTasks') refers to the outer loop's current task. first(...)?['name'] takes the single match, and coalesce(..., 'Unknown Bucket') covers a task whose bucket was deleted.

The three new actions and the modified append are covered in detail in section 8 and section 9.

Step 11: Apply to each FilteredTasks 2, the upcoming loop (modified)

This loop is identical in structure, iterating over @body('Filter_array_2') and using the _2 twins of every inner action. It appends to TasksArray2 with a Due Date key instead of Overdue Date. See section 10.

Both loops use the default concurrency (no runtimeConfiguration in the definition), so iterations run sequentially and rows are appended in the order the filter returned them.

Step 12: Create HTML table / Create HTML table 2 (legacy, unchanged)

"Create_HTML_table":   { "type": "Table", "inputs": { "from": "@variables('TasksArray')",  "format": "HTML" } },
"Create_HTML_table_2": { "type": "Table", "inputs": { "from": "@variables('TasksArray2')", "format": "HTML" } }

These still run but are no longer referenced by any email. Because they use automatic columns, they would now include an Assigned To column too (with the zero-width separator described later), which is harmless since nobody sees them.

Step 13: Overdue Count / Upcoming Count (unchanged)

"Overdue_Count":  { "type": "Compose", "inputs": "@length(variables('TasksArray'))" },
"Upcoming_Count": { "type": "Compose", "inputs": "@length(variables('TasksArray2'))" }

These drive both the branch conditions and the first two summary cards.

Step 14: Filter array (Open tasks) and Filter array (Completed last 7 days) (new)

Explained in section 11.

Step 15: Select Overdue Rows / Select Upcoming Rows (new)

These turn each array into a list of <tr> strings with inline styles, numbering, escaped text, assignee chips and date highlighting. Explained in sections 9, 10 and 12, with full expressions in Appendix B.

Step 16: Compose Email HTML (new)

A single Compose whose input is the full HTML document with @{...} tokens for the counts and table bodies. The full template is in Appendix A.

Step 17: Condition 3 and the email branches (runAfter and bodies modified)

"Condition_3": {
  "type": "If",
  "runAfter": { "Compose_Email_HTML": ["Succeeded"] },
  "expression": {
    "or": [
      { "greater": ["@outputs('Overdue_Count')", 0] },
      { "greater": ["@outputs('Upcoming_Count')", 0] }
    ]
  }
}

The only change is runAfter, from Upcoming_Count to Compose_Email_HTML. The nested Both_Exist (and of both counts > 0) and Only_Overdue_Check (overdue > 0) conditions are untouched. See section 14 for the email actions.

Step 18: Terminate (unchanged)

"Terminate": { "type": "Terminate", "runAfter": { "Condition_3": ["Succeeded"] }, "inputs": { "runStatus": "Succeeded" } }

8. Resolving Assignee IDs to Display Names

This was the core requirement, and it is the part of the flow I would encourage other developers to copy.

8.1 Why the IDs cannot be shown directly

As shown in section 5, each task carries an assignments object keyed by user object ID and an _assignments array. A GUID means nothing to a reader, and the connector has no "assignee names" output. The IDs must be resolved against a directory source.

8.2 Choosing the lookup strategy

I considered two approaches.

Per-task user lookup. Inside each loop, run an Apply to each over the task's assignments and call Office 365 Users → Get user profile (V2) for each ID. It works, but the number of connector calls grows with tasks × assignees. With 14 relevant tasks and up to two assignees each, that is around 20 extra API calls per run, more on a bad week, all counting against the flow's request limits and adding latency and throttling exposure. It would also have meant nested loops inside loops.

One group-member list per run. The plan belongs to a Microsoft 365 group, and its assignees are that group's members. A single Office 365 Groups → List group members call returns every member's id and displayName. Matching IDs to names then becomes an in-memory Filter array with no further connector calls.

I went with the second approach. It costs one API call per run regardless of task count, needs no nested loop and uses a standard connector that was already licensed. In the run history, List group members took about one second, and the whole run took about 11 seconds both before and after the change.

The trade-off: an assignee who is not a member of the group (for example, a guest who was removed from the group but is still assigned) cannot be resolved this way. The flow handles that case explicitly, as described below. In the test data every assignee resolved.

8.3 Matching IDs against members: Filter array (Lookup assignees)

Inside the overdue loop:

"Filter_array_(Lookup_assignees)": {
  "type": "Query",
  "runAfter": { "Compose_BucketName": ["Succeeded"] },
  "inputs": {
    "from": "@coalesce(body('List_group_members')?['value'], json('[]'))",
    "where": "@contains(coalesce(items('Apply_to_each_FilteredTasks')?['assignments'], json('{}')), item()?['id'])"
  }
}

Reading it piece by piece:

  • from: the group members. coalesce(..., json('[]')) substitutes an empty array if List_group_members failed and has no body. This is what lets the flow continue after a Groups failure without an expression error.

  • where: for each member (item()), keep it if the current task's assignments object contains a key equal to the member's id. When contains() is given an object, it checks for a key. That is why I matched against assignments (the object keyed by user ID) instead of looping over _assignments.

  • coalesce(..., json('{}')) protects against a task with no assignments property.

The result is the list of member objects assigned to this task. The filter iterates over members, not assignments, so a task with three assignees returns up to three member objects in group-member order.

8.4 Extracting the names: Select assignee names

"Select_assignee_names": {
  "type": "Select",
  "runAfter": { "Filter_array_(Lookup_assignees)": ["Succeeded"] },
  "inputs": {
    "from": "@body('Filter_array_(Lookup_assignees)')",
    "select": "@item()?['displayName']"
  }
}

In the designer, switch the Select's Map to text mode (the small "T" icon) and enter the expression item()?['displayName']. This produces a flat array of strings such as ["Ravi Rajan", "Ankiet Mishra, Consultant"] instead of an array of objects.

8.5 Building the final value: Compose AssignedTo

This is the exact expression from the deployed definition:

@if(equals(length(coalesce(items('Apply_to_each_FilteredTasks')?['_assignments'], json('[]'))), 0), 'Unassigned', if(equals(length(body('Select_assignee_names')), 0), 'User details unavailable', if(less(length(body('Select_assignee_names')), length(coalesce(items('Apply_to_each_FilteredTasks')?['_assignments'], json('[]')))), concat(join(body('Select_assignee_names'), ',​ '), ',​ User details unavailable'), join(body('Select_assignee_names'), ',​ '))))

Important: the separator between names is not a plain ', '. It is comma + U+200B ZERO WIDTH SPACE + space (',​ ' in JSON). The character is invisible in most editors. If you retype the expression by hand, the HTML step later will not split names correctly. Section 8.6 explains why it is there.

The same expression, reformatted with line breaks for reading (Power Automate accepts whitespace between function arguments). ‹SEP› marks where the comma + zero-width space + space literal sits:

if(
  equals(length(coalesce(items('Apply_to_each_FilteredTasks')?['_assignments'], json('[]'))), 0),
  'Unassigned',                                                     -- (1) nobody assigned
  if(
    equals(length(body('Select_assignee_names')), 0),
    'User details unavailable',                                     -- (2) assigned, but none resolved
    if(
      less(length(body('Select_assignee_names')),
           length(coalesce(items('Apply_to_each_FilteredTasks')?['_assignments'], json('[]')))),
      concat(join(body('Select_assignee_names'), '‹SEP›'),
             '‹SEP›User details unavailable'),                      -- (3) some resolved, some not
      join(body('Select_assignee_names'), '‹SEP›')                  -- (4) all resolved
    )
  )
)

The four outcomes:

Case

Condition

Output

1

_assignments is empty

Unassigned

2

Assignees exist, but no member matched (or the Groups call failed)

User details unavailable

3

Fewer names than assignees

Name A‹SEP›Name B‹SEP›User details unavailable

4

Every assignee resolved

Name A‹SEP›Name B

I used _assignments (the array) for counting because length() on an array is reliable. I used assignments (the object) for matching because contains() on an object is a key lookup. Using each shape for the job it suits kept both expressions short.

8.6 Names that contain commas

The first deployed version (v1) joined names with a plain ', '. In the HTML step I split on that separator to render one chip per person. On the first real run I noticed that people whose directory display name follows the organisation's "Surname, Title" convention (for example "Ankiet Mishra, Consultant") were rendered as two chips: "John Smith" and "Consultant".

The fix was to separate people with a sequence that never appears inside a display name. I chose comma + zero-width space + space:

  • In any plain-text context (for example the legacy Create HTML table), it still reads as "Ravi Rajan, Ankiet Mishra, Consultant", because the zero-width space is invisible.

  • In the HTML step, replace() targets only that exact three-character sequence, so a comma inside a name is left alone.

Version 2 of the package changed only the separator in both Compose_AssignedTo actions and both Select_*_Rows actions. On the next run, every person appeared as exactly one chip.

8.7 Storing the value with the row

The append action gained one key:

"Append_to_array_variable_2": {
  "type": "AppendToArrayVariable",
  "runAfter": { "Compose_AssignedTo": ["Succeeded"] },
  "inputs": {
    "name": "TasksArray",
    "value": {
      "Bucket Name": "@{outputs('Compose_BucketName')}",
      "Task Name": "@{items('Apply_to_each_FilteredTasks')?['title']}",
      "Assigned To": "@{outputs('Compose_AssignedTo')}",
      "Overdue Date": "@{formatDateTime(item()?['dueDateTime'], 'dd-MMM-yyyy')}"
    }
  }
}

Its runAfter moved from Compose_BucketName to Compose_AssignedTo, so the name is ready before the row is written. Inside an Apply to each, a bare item() is the loop's current element, so item()?['dueDateTime'] is the task's due date.

8.8 Rendering names as chips

In the row Select, the stored string is HTML-escaped and each separator is replaced with "close chip, open next chip". The fragment from Select_Overdue_Rows (the ‹SEP› literal is again comma + zero-width space + space):

'<td style="...">'
  '<span style="display:inline-block;padding:2px 9px;margin:1px 2px 1px 0;border-radius:11px;background:#EEF2FA;color:#1E3A6E;font-size:12px;white-space:nowrap;">',
  replace(
    replace(replace(replace(string(variables('TasksArray')[item()]?['Assigned To']),'&','&amp;'),'<','&lt;'),'>','&gt;'),
    '‹SEP›',
    '</span> <span style="display:inline-block;padding:2px 9px;margin:1px 2px 1px 0;border-radius:11px;background:#EEF2FA;color:#1E3A6E;font-size:12px;white-space:nowrap;">'
  ),
'</span></td>'

The opening <span> starts the first chip, each separator becomes </span> <span ...> and the closing </span> ends the last chip. white-space:nowrap keeps each name on one line, while the plain space between spans lets chips wrap onto a second line in narrow columns, which is what you see for two-person rows in the desktop render.

"Unassigned" and "User details unavailable" render as single chips through the same path, so no special HTML case is needed.


9. Overdue Task Processing

Identification. Filter_array (section 7, step 6) selects tasks with a due date before utcNow() and percentComplete < 100. I did not change this rule.

Population. Apply_to_each_FilteredTasks iterates over body('Filter_array'). For each task it resolves the bucket name (Compose_BucketName), resolves assignees (Compose_AssignedTo) and appends one object to TasksArray:

{
  "Bucket Name": "Collaboration Platforms",
  "Task Name": "Quarterly Licence Review",
  "Assigned To": "Ravi Rajan‹SEP›Ankiet Mishra, Consultant",
  "Overdue Date": "25-Nov-2026"
}

(Values illustrative. Assignee names are placeholders.)

Date format. formatDateTime(item()?['dueDateTime'], 'dd-MMM-yyyy') produces 25-Nov-2026. This was the original format and I kept it. It is unambiguous across regions, unlike 11/25/2026 vs 25/11/2026.

Sequential numbering. The obvious way to number rows would be an integer variable incremented inside the loop. That adds a variable, an increment action per loop and a dependency on sequential concurrency. Instead, the Select iterates over indices, not rows:

"from":   "@range(0, length(variables('TasksArray')))"

range(0, n) yields [0, 1, ..., n-1]. Inside the Select, item() is the index, so:

  • string(add(item(),1)) is the row number, starting at 1.

  • variables('TasksArray')[item()]?['Task Name'] reads the row's data.

  • mod(item(),2) drives the zebra striping.

Because each table has its own Select and its own range(), numbering restarts at 1 in each table automatically.

Building the row. Each <tr> is a concat() of five cells. The full expression is in Appendix B. The key parts:

'<tr style="background:', if(equals(mod(item(),2),1),'#F7F9FC','#FFFFFF'), ';">'   -- zebra stripe
'<td ...text-align:center;color:#6B7280;width:48px;">', string(add(item(),1)), '</td>'  -- No.
'<td ...>', <escaped Bucket Name>, '</td>'
'<td ...font-weight:600;">', <escaped Task Name>, '</td>'
'<td ...>', <assignee chips>, '</td>'
'<td ...background:#FDECEC;color:#C50F1F;font-weight:700;white-space:nowrap;">&#128197;&nbsp;', <Overdue Date>, '</td></tr>'

Escaping. Task titles are user-entered. A title containing < or & would break the HTML or, in theory, inject markup. Each text field passes through:

replace(replace(replace(string(<value>),'&','&amp;'),'<','&lt;'),'>','&gt;')

& is replaced first so that the & in &lt; and &gt; is not escaped twice.

Highlighting. Every overdue date cell uses the same treatment: red text #C50F1F, bold, on a #FDECEC pink background, with a calendar emoji (&#128197;). Every row in this table is overdue by definition, so there is no conditional logic here.

Table assembly. In Compose_Email_HTML, the overdue section uses:

@{if(equals(length(variables('TasksArray')),0),
     '<table ...>... No overdue tasks ... Great work – nothing is past its due date. ...</table>',
     concat('<table ...><tr><th>No.</th><th>Bucket Name</th><th>Task Name</th><th>Assigned To</th><th>Overdue Date</th></tr>',
            join(body('Select_Overdue_Rows'),''),
            '</table>'))}

(Inline styles omitted here for readability. See Appendix A for the exact markup.)

join(..., '') concatenates the row strings. When the array is empty the reader sees a friendly "No overdue tasks" card instead of an empty header row.


10. Upcoming Task Processing

Identification. Filter_array_2 selects tasks with utcNow() ≤ dueDateTime ≤ utcNow() + 7 days and percentComplete < 100 (unchanged).

Population. Apply_to_each_FilteredTasks_2 mirrors the overdue loop with _2 actions and appends to TasksArray2:

"Append_to_array_variable": {
  "type": "AppendToArrayVariable",
  "runAfter": { "Compose_AssignedTo_2": ["Succeeded"] },
  "inputs": {
    "name": "TasksArray2",
    "value": {
      "Bucket Name": "@{outputs('Compose_BucketName_2')}",
      "Task Name": "@{items('Apply_to_each_FilteredTasks_2')?['title']}",
      "Assigned To": "@{outputs('Compose_AssignedTo_2')}",
      "Due Date": "@{formatDateTime(item()?['dueDateTime'], 'dd-MMM-yyyy')}"
    }
  }
}

Note the naming quirk inherited from the original flow: the overdue loop's append is called Append_to_array_variable_2 and the upcoming loop's append is Append_to_array_variable. I kept the original names so the change set stayed small and the definition diff stayed readable.

The _2 assignee actions are identical apart from their references:

"Filter_array_(Lookup_assignees)_2": {
  "inputs": {
    "from": "@coalesce(body('List_group_members')?['value'], json('[]'))",
    "where": "@contains(coalesce(items('Apply_to_each_FilteredTasks_2')?['assignments'], json('{}')), item()?['id'])"
  }
},
"Select_assignee_names_2": {
  "inputs": {
    "from": "@body('Filter_array_(Lookup_assignees)_2')",
    "select": "@item()?['displayName']"
  }
}

Compose_AssignedTo_2 is the section 8.5 expression with Apply_to_each_FilteredTasks replaced by Apply_to_each_FilteredTasks_2 and Select_assignee_names replaced by Select_assignee_names_2. The exact text:

@if(equals(length(coalesce(items('Apply_to_each_FilteredTasks_2')?['_assignments'], json('[]'))), 0), 'Unassigned', if(equals(length(body('Select_assignee_names_2')), 0), 'User details unavailable', if(less(length(body('Select_assignee_names_2')), length(coalesce(items('Apply_to_each_FilteredTasks_2')?['_assignments'], json('[]')))), concat(join(body('Select_assignee_names_2'), ',​ '), ',​ User details unavailable'), join(body('Select_assignee_names_2'), ',​ '))))

Independent numbering. Select_Upcoming_Rows uses range(0, length(variables('TasksArray2'))), so its numbering starts at 1 regardless of how many overdue rows there are.

10.1 Due today, Due tomorrow and In 2 days

The upcoming table highlights rows that are close to their deadline. The row only has the formatted Due Date string, so the expression parses it back and counts whole days from the start of today:

div(
  sub(
    ticks(parseDateTime(variables('TasksArray2')[item()]?['Due Date'], 'en-US', 'dd-MMM-yyyy')),
    ticks(startOfDay(utcNow()))
  ),
  864000000000
)
  • parseDateTime(..., 'en-US', 'dd-MMM-yyyy') turns 26-Nov-2026 back into a timestamp at midnight. The en-US locale guarantees Nov is understood.

  • ticks() converts both timestamps to 100-nanosecond ticks.

  • 864000000000 is the number of ticks in one day (24 × 60 × 60 × 10,000,000).

  • div() on integers truncates, giving a whole number of days.

Comparing dates (midnight to midnight) instead of exact timestamps means a task due "tomorrow at 08:00" counts as 1 day away whether the flow runs at 05:15 or 09:15.

That day count is used twice in the date cell:

  1. Cell styling. If days ≤ 2, the cell gets amber styling, otherwise normal text:

    if(lessOrEquals(<days>, 2),
       'color:#B45309;font-weight:700;background:#FFF4E0;',
       'color:#1F2937;')
  2. Badge. A nested if adds a small orange pill:

    if(lessOrEquals(<days>,0), '&nbsp;<span style="...background:#F59E0B;color:#FFFFFF;...">Due today</span>',
    if(equals(<days>,1),       '&nbsp;<span style="...">Due tomorrow</span>',
    if(equals(<days>,2),       '&nbsp;<span style="...">In 2 days</span>',
    '')))

    lessOrEquals(..., 0) instead of equals(..., 0) is deliberate. It is defensive, so that any edge case producing a negative day count still renders "Due today" instead of nothing.

Rows 3 to 7 days out render normally. In the verified email, two rows showed Due tomorrow and two showed In 2 days, and the rest were plain.

Time zone caveat. startOfDay(utcNow()) and formatDateTime(dueDateTime) both work in UTC, which matches the utcNow()-based filters the flow already used. For a team at UTC+4 this lines up for typical due dates. If your users are many hours from UTC and their due dates fall near midnight, wrap both sides in convertFromUtc(..., '<your time zone>') and apply the same conversion consistently in the filters.


11. Calculating Dashboard Summary Cards

The four cards in section C of the email read from four sources:

Card

Expression in Compose_Email_HTML

Source

Overdue Tasks

@{outputs('Overdue_Count')}

length(variables('TasksArray')) (existing)

Upcoming Tasks (Next 7 Days)

@{outputs('Upcoming_Count')}

length(variables('TasksArray2')) (existing)

Total Open Tasks

@{length(body('Filter_array_(Open_tasks)'))}

New filter

Completed (Last 7 Days)

@{length(body('Filter_array_(Completed_last_7_days)'))}

New filter

I reused the existing count actions for the first two cards so the numbers in the cards and the numbers driving the branch conditions can never disagree.

Filter array (Open tasks)

"Filter_array_(Open_tasks)": {
  "type": "Query",
  "runAfter": { "Upcoming_Count": ["Succeeded"] },
  "inputs": {
    "from": "@outputs('List_tasks')?['body/value']",
    "where": "@less(item()?['percentComplete'], 100)"
  }
}

Every incomplete task in the plan, whether "Not started" (0) or "In progress" (50), and whether or not it has a due date.

Filter array (Completed last 7 days)

"Filter_array_(Completed_last_7_days)": {
  "type": "Query",
  "runAfter": { "Filter_array_(Open_tasks)": ["Succeeded"] },
  "inputs": {
    "from": "@outputs('List_tasks')?['body/value']",
    "where": "@and(equals(item()?['percentComplete'], 100), not(empty(item()?['completedDateTime'])), greaterOrEquals(item()?['completedDateTime'], addDays(utcNow(), -7)))"
  }
}

Completed tasks whose completedDateTime falls in the last seven days. The not(empty(...)) guard avoids comparing a null. Because List tasks returns completed tasks as well, no extra connector call was needed.

Why Total Open is larger than Overdue + Upcoming

In the verified run the cards read 1 / 13 / 39 / 3. Overdue + Upcoming = 14, but Total Open = 39. That is correct, not a bug. The other 25 open tasks either have no due date or are due more than seven days out. I added the subtitle "All incomplete tasks in plan" under that card so readers would not expect the numbers to add up.

These numbers are from one specific test run and will change every day. Nothing in the template is hard-coded except labels.


12. Designing the HTML Email Using HTML and CSS

Email HTML is not web HTML. Outlook for Windows renders mail with the Word engine, which ignores much of modern CSS. Outlook on the web and the mobile apps rewrite and sanitise markup, and Gmail strips <style> blocks in some contexts. A few rules follow from that, and the whole template is written to them:

  1. Layout with nested <table role="presentation">, never div + flexbox/grid. Tables are the one layout primitive every client agrees on. role="presentation" tells screen readers these are not data tables.

  2. Inline styles on every element. Styles in <head> may be dropped, while inline style="" attributes survive. The only <style> block is a media query that enhances the mobile layout. If it is stripped, the email still works at desktop width.

  3. No JavaScript, no external CSS, no web fonts, no images. Scripts are stripped. External resources are blocked by default in most corporate Outlook setups. The icons are emoji/HTML entities (&#128197;, &#9888;&#65039;, &#9989;) and the Planner badge is a styled table cell with the letter P, so the email is complete even with external content blocked.

  4. A system font stack: font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;, repeated on every text cell because inheritance is unreliable in Outlook.

  5. Conditional comments for Outlook desktop (mso): a fixed-width ghost table and a VML button.

Below is each section, copied from Compose_Email_HTML_template.html (identical to the deployed Compose_Email_HTML input).

12.1 Document head and responsive rules

<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<style>@media only screen and (max-width:700px){.stack{display:block!important;width:100%!important;box-sizing:border-box;}.hide-sm{display:none!important;}.pad-sm{padding-left:14px!important;padding-right:14px!important;}.sec-sm{padding-left:10px!important;padding-right:10px!important;}.scroll-sm{display:block!important;width:calc(100vw - 42px)!important;max-width:calc(100vw - 42px)!important;overflow-x:auto!important;-webkit-overflow-scrolling:touch;}}</style></head>

Five utility classes do all the responsive work below 700 px:

Class

Effect on small screens

Used on

.stack

Table cells become full-width blocks, so they stack vertically

Summary cards, action panel, footer

.hide-sm

Hidden

Header icon tile and Planner badge

.pad-sm

Tighter side padding

Header title, greeting

.sec-sm

Tighter section padding

Table sections

.scroll-sm

Table wrapper becomes a horizontally scrollable block capped at viewport width

Both table wrappers (added in v3)

!important is required because these rules must override the inline styles.

12.2 Outer container

<body style="margin:0;padding:0;background:#EEF2F8;">
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="background:#EEF2F8;"><tr><td align="center" style="padding:20px 10px;">
<!--[if mso]><table role="presentation" width="1040" cellpadding="0" cellspacing="0" border="0"><tr><td><![endif]-->
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="max-width:1040px;width:100%;background:#FFFFFF;border:1px solid #DCE3EE;border-radius:12px;">
  ...
</table>
<!--[if mso]></td></tr></table><![endif]-->
</td></tr></table></body></html>

A full-width background table centres a white card with max-width:1040px. Outlook desktop ignores max-width, so the <!--[if mso]> ghost table pins the width to 1040 px there. Every other client skips the conditional comment.

12.3 Header (Section A)

<!-- SECTION A: HEADER -->
<tr><td style="background:#0B2A5B;border-radius:12px 12px 0 0;padding:0;">
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0"><tr>
<td width="76" valign="middle" class="hide-sm" style="padding:22px 0 22px 28px;">
<table role="presentation" cellpadding="0" cellspacing="0" border="0"><tr><td width="54" height="54" align="center" valign="middle" style="background:#0F6CBD;border-radius:12px;font-size:28px;line-height:54px;">&#128197;</td></tr></table></td>
<td valign="middle" class="pad-sm" style="padding:22px 20px;font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;">
<div style="font-size:24px;line-height:30px;font-weight:700;color:#FFFFFF;"><span style="color:#FF8A80;">Action Required:</span> Review Upcoming &amp; Overdue Planner Tasks</div>
<div style="font-size:14px;line-height:20px;color:#C7D7F2;padding-top:4px;">Microsoft Planner &ndash; Task Review &amp; Follow-Up</div></td>
<td width="190" valign="middle" align="right" class="hide-sm" style="padding:22px 28px 22px 0;">
<table role="presentation" cellpadding="0" cellspacing="0" border="0"><tr>
<td width="38" height="38" align="center" valign="middle" style="background:#31752F;border-radius:8px;font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:21px;font-weight:700;color:#FFFFFF;line-height:38px;">P</td>
<td style="padding-left:10px;font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:15px;line-height:18px;color:#FFFFFF;font-weight:600;">Microsoft<br>Planner</td></tr></table></td>
</tr></table>
<div style="height:4px;line-height:4px;font-size:0;background:#0F6CBD;">&nbsp;</div></td></tr>

Three cells: icon tile, title block and Planner badge. On mobile the outer two are hidden, so the title gets the full width. The 4 px blue strip at the bottom uses the height + line-height + font-size:0 + &nbsp; combination, which stops Outlook from inflating an "empty" div to a full text line.

12.4 Greeting (Section B)

<!-- SECTION B: GREETING -->
<tr><td class="pad-sm" style="padding:24px 28px 8px 28px;font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;">
<div style="font-size:17px;font-weight:700;color:#111827;">Hi Ravi,</div>
<div style="font-size:14px;line-height:21px;color:#374151;padding-top:6px;">Please review the Planner tasks that are overdue or still open, and take the necessary action.</div></td></tr>

The greeting name is hard-coded, exactly as it was in the original flow. If the flow ever goes to several recipients, change this to a neutral "Hi team,".

12.5 Summary cards (Section C)

One of the four cards. The others differ only in colours, icon, value expression and label:

<td class="stack" width="25%" valign="top" style="padding:0 6px 12px 6px;">
  <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="background:#FEF3F3;border:1px solid #F7D4D4;border-radius:10px;"><tr>
    <td width="58" valign="middle" style="padding:16px 0 16px 16px;">
      <table role="presentation" cellpadding="0" cellspacing="0" border="0"><tr><td width="44" height="44" align="center" valign="middle" style="background:#FAD4D4;border-radius:10px;font-size:22px;line-height:44px;">&#9888;&#65039;</td></tr></table></td>
    <td valign="middle" style="padding:14px 14px 14px 12px;font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;">
      <div style="font-size:30px;line-height:34px;font-weight:700;color:#0B2A5B;">@{outputs('Overdue_Count')}</div>
      <div style="font-size:13px;color:#374151;">Overdue Tasks</div></td>
  </tr></table></td>

Card

Background / border / icon tile

Icon

Value

Overdue

#FEF3F3 / #F7D4D4 / #FAD4D4

&#9888;&#65039; ⚠️

@{outputs('Overdue_Count')}

Upcoming

#F2F7FE / #D3E3F8 / #D6E6FB

&#128198; 📆

@{outputs('Upcoming_Count')}

Total Open

#F4F6FD / #DCE1F2 / #DCE1F7

&#128203; 📋

@{length(body('Filter_array_(Open_tasks)'))}

Completed

#F1FAF4 / #D2ECD9 / #D3F0DC

&#9989; ✅

@{length(body('Filter_array_(Completed_last_7_days)'))}

On desktop the four width="25%" cells sit in a row. Below 700 px .stack turns them into four full-width cards stacked vertically, as in the 390 px render.

12.6 Table sections (Sections D and E)

Each table section is two rows: a tinted title bar and a wrapper div holding the dynamically generated table.

<!-- SECTION D: OVERDUE -->
<tr><td style="padding:8px 28px 0 28px;"><table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="background:#FDECEC;border:1px solid #F4C7C7;border-bottom:0;border-radius:8px 8px 0 0;"><tr><td style="padding:12px 16px;font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:17px;font-weight:700;color:#A4262C;">&#9888;&#65039;&nbsp;&nbsp;Overdue Tasks <span style="font-weight:400;">(Action Required)</span></td></tr></table></td></tr>
<tr><td class="sec-sm" style="padding:0 28px 18px 28px;"><div class="scroll-sm" style="background:#FFF7F7;border:1px solid #F4C7C7;border-top:0;border-radius:0 0 8px 8px;padding:0;overflow-x:auto;">@{ ...if / concat expression from section 9... }</div></td></tr>

The header cell style used for every column heading:

<th style="padding:10px 14px;font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px;font-weight:700;color:#FFFFFF;text-align:left;background:#0B2A5B;border-right:1px solid #1E3F77;">Bucket Name</th>

The No. header adds text-align:center;width:48px; and the last header adds border-right:0;. Some properties appear twice in one style attribute (for example text-align:left;...text-align:center;). That is a side effect of generating the styles from a shared base string, and it is harmless because the later declaration wins.

The upcoming section (E) is identical apart from the blue palette (#E8F1FC / #C7DBF5 / #0B4A8B), the 📆 icon, the title "Upcoming Tasks – Due in Next 7 Days", the Due Date column and the "No tasks due in the next 7 days" empty state.

12.7 Data rows, assignee chips and date badges

A rendered overdue row, as produced by Select_Overdue_Rows (sample values):

<tr style="background:#FFFFFF;">
  <td style="padding:9px 14px;border-bottom:1px solid #E3E8F0;font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px;color:#1F2937;text-align:center;color:#6B7280;width:48px;">1</td>
  <td style="padding:9px 14px;border-bottom:1px solid #E3E8F0;font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px;color:#1F2937;">Collaboration Platforms</td>
  <td style="padding:9px 14px;border-bottom:1px solid #E3E8F0;font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px;color:#1F2937;font-weight:600;">Quarterly Licence Review</td>
  <td style="padding:9px 14px;border-bottom:1px solid #E3E8F0;font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px;color:#1F2937;">
    <span style="display:inline-block;padding:2px 9px;margin:1px 2px 1px 0;border-radius:11px;background:#EEF2FA;color:#1E3A6E;font-size:12px;white-space:nowrap;">Ravi Rajan</span>
    <span style="display:inline-block;padding:2px 9px;margin:1px 2px 1px 0;border-radius:11px;background:#EEF2FA;color:#1E3A6E;font-size:12px;white-space:nowrap;">Ankiet Mishra, Consultant</span></td>
  <td style="padding:9px 14px;border-bottom:1px solid #E3E8F0;font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px;color:#1F2937;background:#FDECEC;color:#C50F1F;font-weight:700;white-space:nowrap;">&#128197;&nbsp;25-Nov-2026</td>
</tr>

(Line breaks added for readability. The Select emits each row as one line.)

An upcoming date cell that is due tomorrow:

<td style="...white-space:nowrap;color:#B45309;font-weight:700;background:#FFF4E0;">&#128197;&nbsp;26-Nov-2026&nbsp;<span style="display:inline-block;padding:1px 7px;border-radius:9px;background:#F59E0B;color:#FFFFFF;font-size:11px;font-weight:700;">Due tomorrow</span></td>

border-radius on chips and badges is ignored by Outlook desktop, which renders square-cornered labels. That is an acceptable degradation, and the colour still carries the meaning.

12.8 Action panel (Section F)

<!-- SECTION F: ACTION REQUESTED -->
<tr><td style="padding:4px 28px 20px 28px;">
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="background:#F2F6FC;border:1px solid #D3E0F2;border-left:5px solid #0F6CBD;border-radius:8px;"><tr>
<td class="stack" valign="top" style="padding:18px 20px;font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;">
<div style="font-size:16px;font-weight:700;color:#0B2A5B;padding-bottom:6px;">&#127919;&nbsp;Action Requested:</div>
<table role="presentation" cellpadding="0" cellspacing="0" border="0" style="font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:14px;line-height:22px;color:#374151;">
<tr><td valign="top" style="padding-right:8px;color:#0F6CBD;">&#9679;</td><td>Review the tasks listed above.</td></tr>
<tr><td valign="top" style="padding-right:8px;color:#0F6CBD;">&#9679;</td><td>Update the status in Microsoft Planner.</td></tr>
<tr><td valign="top" style="padding-right:8px;color:#0F6CBD;">&#9679;</td><td>Take necessary actions to close or reassign tasks, if required.</td></tr>
</table></td>
<td class="stack" valign="middle" align="right" style="padding:18px 22px;">
  ... button, see section 13 ...
</td></tr></table></td></tr>

The bullets are a two-column table with a &#9679; dot, not <ul>. Outlook's list indentation is inconsistent, and a table gives exact control.

<!-- SECTION G: FOOTER -->
<tr><td style="padding:0 28px;"><div style="height:1px;line-height:1px;font-size:0;background:#E5E9F0;">&nbsp;</div></td></tr>
<tr><td style="padding:16px 28px 22px 28px;">
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0"><tr>
<td class="stack" valign="top" style="font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:14px;line-height:20px;color:#374151;">Regards,<br><b style="color:#111827;">MS Planner</b></td>
<td class="stack" valign="bottom" align="right" style="font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:12px;line-height:18px;color:#6B7280;font-style:italic;">&#9432;&nbsp;This is an automated reminder from Microsoft Planner. Please keep task status up to date.</td>
</tr></table></td></tr>

12.10 Mobile behaviour

At 390 px (a typical phone width) the header icons disappear, the cards stack, the action panel and button stack and each task table becomes a horizontally scrollable strip inside its rounded wrapper (see section 16 for why that last part was needed). Five columns of real task data cannot fit legibly in 390 px, so I did not try to restructure the table into cards. Letting the table scroll keeps the No./Bucket/Task columns readable and the rest one swipe away.


13. Implementing the Open in Microsoft Planner Button

The button links straight to the plan's board view in the new Planner web experience:

https://planner.cloud.microsoft/ui/web/plan/<your-plan-id>/view/board?tid=<your-tenant-id>
  • <your-plan-id> is the same plan ID used by List buckets / List tasks.

  • tid is your Entra ID tenant ID. Including it avoids an account-picker detour for users signed into more than one tenant.

The easiest way to get the right URL is to open the plan in a browser, switch to Board view and copy the address bar.

The markup is a "bulletproof button": a VML rounded rectangle for Outlook desktop and a styled anchor for everything else.

<table role="presentation" cellpadding="0" cellspacing="0" border="0"><tr>
<td align="center" bgcolor="#0F6CBD" style="background:#0F6CBD;border-radius:6px;">
<!--[if mso]><v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" href="https://planner.cloud.microsoft/ui/web/plan/<your-plan-id>/view/board?tid=<your-tenant-id>" style="height:46px;v-text-anchor:middle;width:260px;" arcsize="12%" stroke="f" fillcolor="#0F6CBD"><center style="color:#FFFFFF;font-family:Segoe UI,Arial,sans-serif;font-size:15px;font-weight:bold;">Open in Microsoft Planner &#8599;</center></v:roundrect><![endif]-->
<!--[if !mso]><!--><a href="https://planner.cloud.microsoft/ui/web/plan/<your-plan-id>/view/board?tid=<your-tenant-id>" target="_blank" style="display:inline-block;padding:13px 28px;font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:15px;font-weight:700;color:#FFFFFF;text-decoration:none;border-radius:6px;background:#0F6CBD;">Open in Microsoft Planner &#8599;</a><!--<![endif]-->
</td></tr></table>

Why both:

  • Outlook for Windows does not apply padding or display:inline-block to <a>, so a styled link collapses to underlined text. The VML v:roundrect draws a real 260 × 46 px rounded button, and its href makes the whole shape clickable.

  • <!--[if !mso]><!-->...<!--<![endif]--> hides the HTML anchor from Outlook desktop (avoiding a double button) while every other client renders it.

  • The wrapping <td bgcolor="#0F6CBD"> gives a blue background even if a client drops the anchor's background.

I verified the anchor's href in Outlook on the web. I did not have Outlook desktop for Windows available, so the VML branch follows the standard pattern but was not visually verified in that client. Test it there if your audience uses it.


14. Send an Email V2 Configuration

All three send actions use Office 365 Outlook → Send an email (V2) (SendEmailV2). Only the Body changed. To, Subject and Importance are exactly as they were.

Action

Branch

Subject

Body

Send_an_email_(V2)

Condition_3 yes → Both_Exist yes

Action Required: Review Upcoming & Overdue Planner Tasks

@{outputs('Compose_Email_HTML')}

Send_an_email_(V2)_1

Both_Exist no → Only_Overdue_Check yes

Action Required: Review Overdue Planner Tasks

@{outputs('Compose_Email_HTML')}

Send_an_email_(V2)_3

Only_Overdue_Check no

Action Required: Review Upcoming Planner Tasks

@{outputs('Compose_Email_HTML')}

Compose_1

Condition_3 no

(no email; composes "There is No task")

n/a

The deployed definition of the first action, with the address replaced:

"Send_an_email_(V2)": {
  "type": "OpenApiConnection",
  "runAfter": {},
  "inputs": {
    "host": {
      "apiId": "/providers/Microsoft.PowerApps/apis/shared_office365",
      "connectionName": "shared_office365",
      "operationId": "SendEmailV2"
    },
    "parameters": {
      "emailMessage/To": "ravi.rajan@contoso.com",
      "emailMessage/Subject": "Action Required: Review Upcoming & Overdue Planner Tasks",
      "emailMessage/Body": "@{outputs('Compose_Email_HTML')}",
      "emailMessage/Importance": "High"
    },
    "authentication": "@parameters('$authentication')"
  }
}

Configuration notes:

  • To: a single address in every branch. In this test copy of the flow, that address was already the developer's own mailbox before I started, so every test email went only to me. CC and BCC are not set in any branch.

  • Subject: one per branch, unchanged. This is the only part of the message that still varies by scenario.

  • Body: set the field to the Compose Email HTML output via dynamic content. In the new designer, make sure the body editor is in code view (</>) before pasting anything. Rich-text mode will HTML-encode your markup. Using a single dynamic token avoids the problem entirely.

  • Importance: High, unchanged.

  • From / Send as: not set, so the message is sent as the Outlook connection's account.

Test vs. production recipients. The flow I modified is the "Test - ProdNotify" copy, and I deliberately did not change its recipients. When you promote the design to the production flow, set To (and CC if needed) to the real distribution list or team lead, ideally a distribution list or a single environment variable, so you are not editing three actions every time someone changes role. Remember to update the hard-coded greeting at the same time.

An illustrative comparison using the sample cast (these addresses are fictitious):

Field

Test configuration

Example production configuration

To

ravi.rajan@contoso.com (the developer only)

ravi.rajan@contoso.com (team lead)

CC

(empty)

ankiet.mishra@contoso.com; aman.gupta@contoso.com

BCC

(empty)

(empty)

Subject

Unchanged per branch

Unchanged per branch

Importance

High

High

In Send an email (V2), CC and BCC are under Show all / Advanced parameters. Separate multiple addresses with semicolons. Apply the same values to all three send actions.


15. Testing and Validation

15.1 What I tested and when

All test runs were manual Run triggers in the dev environment, sending only to my own mailbox.

Run (local time, UTC+4)

Version

What it proved

Result

25 Nov 2026, 23:24

Original (before any change)

Baseline: captured the original email for comparison

Succeeded

25 Nov 2026, 23:55

v1 package

List group members and all new actions run. Names resolve. Cards populate. Found: names containing ", " split into two chips

Succeeded

26 Nov 2026, 00:00

v2 package

Separator fix: one chip per person, multi-assignee rows correct

Succeeded

26 Nov 2026, 00:08

v3 package (final)

Mobile scroll fix. Full verification in Outlook Sent Items

Succeeded

Each run took 11–12 seconds. The run history showed all four runs Succeeded, with the same average duration (about 11 s) before and after the change, which confirmed that the member lookup added no meaningful cost.

15.2 The baseline

Before touching anything, I exported the flow (the rollback package) and ran it once. That gave me a "before" email in Sent Items with the original three-column grey tables, and a known-good run to compare action outputs against.

15.3 First implementation (v1)

The first import ran cleanly. In the run view, List group members succeeded in about one second, and every downstream action went green. In Outlook on the web the new layout rendered as designed. Reading the Assigned To column row by row, I noticed that people whose display name includes ", Consultant" showed up as two chips. The data was correct. The rendering was wrong. See section 8.6.

15.4 Multiple-assignee validation (v2)

After changing the separator, I checked specifically:

  • rows with one assignee → one chip,

  • rows with two assignees, both with comma-containing names → exactly two chips,

  • rows mixing a comma-containing name and a plain name → two chips.

The final run had several two-person rows in the upcoming table, and all rendered correctly.

15.5 Mobile overflow (v3)

I rendered the composed HTML with the real run's data at 1140 px and at 390 px. At 390 px the cards and panels stacked correctly, but the five-column tables pushed past the right edge of the card and widened the whole message. Version 3 added the .scroll-sm class to both table wrappers (section 16). The 390 px render then kept the card within the viewport, with each table scrolling horizontally inside its frame.

15.6 Final verification

The v3 email, checked in Outlook on the web, Sent Items:

  • Cards: 1 overdue, 13 upcoming, 39 total open, 3 completed in last 7 days (example values from that run).

  • 14 data rows in total, every one with a real resolved name (no "Unassigned", no "User details unavailable" in that dataset).

  • Numbering 1 in the overdue table and 1–13 in the upcoming table.

  • All dates in dd-MMM-yyyy. "Due tomorrow" and "In 2 days" badges on the correct rows.

  • The Open in Microsoft Planner button's href exactly matched the plan's board URL.

  • High importance flag present. Recipient unchanged.

15.7 How to validate your own build

Use this checklist after each import:

  • ☐ Flow imported with Update, not Create as new. The flow's details page shows the same name, created date and run history.

  • ☐ Flow is On after import.

  • ☐ Manual run succeeds. List group members is green and its output contains value[].id and value[].displayName.

  • ☐ Compose_AssignedTo output for a multi-assignee task contains both names. Check in the run view that the separator is present.

  • ☐ Overdue_Count / Upcoming_Count match the number of rows in each table.

  • ☐ Total Open ≥ Overdue + Upcoming.

  • ☐ Each table numbers from 1.

  • ☐ A task assigned to nobody shows Unassigned. Temporarily unassign a test task to check.

  • ☐ Every name containing a comma appears as one chip.

  • ☐ A task with < or & in its title renders literally, not as broken markup.

  • ☐ The button opens the right board for a user in your tenant.

  • ☐ The email looks right in each client your audience uses (Outlook web, new Outlook, classic Outlook for Windows, Outlook mobile).

  • ☐ Forward the email to a phone and confirm the tables scroll instead of overflowing.

  • ☐ Each of the three branches sends: test with only overdue tasks, only upcoming tasks and both.


16. Troubleshooting and Lessons Learned

16.1 Planner returns user IDs instead of names

Observed in this project. List tasks gives assignments / _assignments keyed by user object ID only. Resolution: one List group members call and an in-memory Filter + Select per task (section 8).

16.2 Multiple assignees

Observed. A task can have any number of assignees. The Filter array approach returns all matching members naturally. join() combines them, and the row Select renders each as a chip. The partial-resolution case (some names found, some not) gets an explicit "User details unavailable" suffix so the reader knows an assignee is missing instead of assuming the list is complete.

16.3 Names containing commas

Observed in v1, fixed in v2. Splitting on ', ' broke "Surname, Title" style names into two chips. Resolution: separate people with comma + zero-width space + space and split only on that sequence. Lesson: never use a delimiter that can appear inside your data, and test with real directory names, not "Test User 1".

16.4 HTML tables overflowing on mobile

Observed in v2, fixed in v3. With long task titles and two-chip assignee cells, the table's minimum width exceeded a phone screen. It stretched the whole card and forced the entire email to scroll sideways. overflow-x:auto on the wrapper alone was not enough, because the wrapper itself grew with its content. Resolution: a media-query class that makes the wrapper a block with a fixed width relative to the viewport:

.scroll-sm{display:block!important;width:calc(100vw - 42px)!important;max-width:calc(100vw - 42px)!important;overflow-x:auto!important;-webkit-overflow-scrolling:touch;}

42px accounts for the outer padding at small widths (10 px page padding each side, the 10 px .sec-sm section padding each side and the borders). The table now scrolls inside its frame and the rest of the email stays put.

16.5 Outlook CSS limitations

Design constraint, partially verified. Outlook for Windows ignores max-width, border-radius, padding on links and most <style> rules. Resolution: inline styles everywhere, an mso ghost table for width and a VML button. I verified rendering in Outlook on the web and in desktop and 390 px HTML renders. Classic Outlook for Windows was not available to me, so treat those specific fallbacks as standard practice that still needs testing in your environment.

16.6 Dynamic date formatting

Design consideration. The row object stores the formatted dd-MMM-yyyy string, not the raw timestamp, so the badge logic must parse it back. parseDateTime(..., 'en-US', 'dd-MMM-yyyy') does that. Leaving out the locale or format string risks failures on month abbreviations. Both sides of the day calculation use UTC (section 10.1).

16.7 Array numbering

Design consideration, not a bug encountered. Select has no built-in index, and a counter variable inside the loops would need sequential concurrency forever. Using range(0, length(array)) as the Select source gives a zero-based index for free and makes numbering independent per table. If you ever enable concurrency on the Apply to each loops, the order of appended rows can change, but numbering stays 1..n.

16.8 Connector or member lookup failures

Designed for. A failure was not observed in testing. If List group members fails:

  1. Compose_Table_CSS still runs (its runAfter accepts Failed / TimedOut / Skipped), so the flow continues.

  2. coalesce(body('List_group_members')?['value'], json('[]')) turns the missing body into an empty array.

  3. Every assigned task shows User details unavailable and the email still sends.

The run will show a failed action in its history even though the overall run succeeds (the final Terminate sets Succeeded). Check run histories periodically. A sudden "User details unavailable" everywhere means the Groups connection needs attention. Also check that $top (999) exceeds your group's size.

16.9 Flow import and connection mapping

Observed. The modified flow was deployed by package import (Power Apps → Import package (legacy)), not by editing in the designer. Points that tripped me up or needed care:

  • The package declares one connection reference per connector. The new Office 365 Groups reference had to be added to the package's manifest.json and to the flow's apisMap.json / connectionsMap.json, then mapped at import time ("Select during import") to an existing Groups connection.

  • Import setup must be Update, targeting the existing flow. Create as new would produce a second flow with a new ID and no run history.

  • The import turns the flow Off. After each import I turned it back on to restore its original state. Forgetting this means the next 09:15 run silently does not happen.


17. Deployment and Maintenance

17.1 Back up first

Before any change I exported the flow as a package (My flows → … → Export → Package (.zip)), with the import setup suggestion set to Update. I named it with the date and purpose (Backup_ProdNotify_Planner_Tasks_2026-11-25_PreEmailRedesign_….zip) and kept two copies. This file is the rollback.

17.2 Build the change

I edited the exported definition.json instead of clicking through the designer. With 12 new actions and some very long expressions, editing JSON is faster and produces a reviewable diff. I kept the build in a small script so each package version (v1, v2, v3) was reproducible from the original export. If you prefer the designer, you can create the same actions by hand. The definitions in this article are what you would paste into each action's expression box.

17.3 Import as an update

  1. Power Apps / Power Automate → Import package, upload the zip.

  2. For the flow resource, set Import setup = Update and choose the existing flow.

  3. For each related resource (Planner, Office 365 Outlook, Office 365 Groups connections), choose Select during import and pick the existing connection.

  4. Import, and wait for "All package resources were successfully imported. The flow has been updated successfully."

17.4 Verify the same flow was updated

Open the flow's details page and check that:

  • the name, Created date and 28-day run history are the original ones, so the flow ID has not changed,

  • the Modified time is your import time.

I also exported the live flow again immediately after the first import and diffed it against the package I had imported: 44 actions, trigger identical. That re-export is the cheapest way to prove what is actually running.

17.5 Turn the flow back on and check the schedule

Toggle the flow On. Open the trigger and confirm Monday–Friday, 09:15, Arabian Standard Time (or your values). The import does not change the trigger, but this is the moment to confirm it.

17.6 Validate recipients

Open each of the three Send an email (V2) actions and confirm To (and CC/BCC if used). In a test copy, they should point at you. In production, at the real audience.

17.7 Monitor

For the first week, check the run history after each 09:15 run. Expand List group members once or twice to confirm it is still succeeding.

17.8 Rollback

Import the backup package with Setup = Update onto the same flow, map the same connections and turn the flow back on. The original 32-action flow and its email return immediately. The unused Groups connection can stay.

17.9 Changing things safely later

  • Recipients / greeting: edit the three send actions and the greeting line in Compose Email HTML.

  • Colours / wording: edit Compose Email HTML. Row-level styles live in the two Select_*_Rows actions.

  • Planner board link: change both href values (VML and anchor) in section F.

  • Badge threshold: change the 2 in lessOrEquals(<days>, 2) and extend the nested if in Select_Upcoming_Rows.

  • Pointing at a different plan: update Group Id and Plan Id in List buckets, List tasks and List group members, plus the button URL.

  • Always export a fresh backup before editing, and re-test multi-assignee and comma-name rows after any change to the separator logic.


18. Final Outcome

The flow now does what the team needed from the start:

  • Automated monitoring. Every weekday at 09:15 the whole plan is evaluated with the same overdue and next-7-days rules as before. No one has to open Planner to know where things stand.

  • Accurate ownership. Every row shows real assignee names, resolved in one connector call per run. Multiple owners, comma-containing names, unassigned tasks and unresolvable users are all handled explicitly.

  • Clear overdue visibility. Overdue work sits at the top, in red, numbered and owned.

  • Deadline awareness. Items due today, tomorrow or in two days stand out in amber before they become overdue.

  • Context at a glance. Four cards show overdue, upcoming, total open and recently completed counts.

  • A professional, readable message that renders in Outlook on the web and on phones, with fallbacks for Outlook desktop, and one click into the Planner board.

  • Less manual follow-up. The reader can message the named owner directly from the email instead of reconstructing who owns what.

Technically, the change added 12 actions and one standard connector call to a 32-action flow, left every existing rule intact and kept run time at around 11 seconds.


19. Conclusion

Most of the effort in this project went into the details. Building a nicer email took an afternoon. Getting an assignee column that is right every time took more thought: a delimiter that survives real directory names, a fallback for when the directory lookup fails, and a mobile layout that does not break when a task title is long.

If you take one thing from this write-up, make it the pattern in section 8: fetch a reference list once per run, then resolve IDs with Filter array and Select inside your loops. It applies well beyond Planner, to SharePoint person fields, Teams members and any connector that hands you IDs when you need names. It keeps connector calls flat as your data grows and keeps the flow easy to read.

The second takeaway is about the email. Treat it as a small, constrained front end: tables for layout, inline styles, no external resources, and an explicit fallback for Outlook desktop. Then test it with the real data your users will see.

Power Automate, Planner and a careful HTML template are enough to replace a daily manual check with a message people actually act on, without new licences, new infrastructure or a rewrite of logic that already worked.


Appendix A: Complete Compose Email HTML Template

This is the complete input of the Compose_Email_HTML action, identical to deliverables/Compose_Email_HTML_template.html except for these placeholder substitutions: the greeting name → Ravi, the plan ID → <your-plan-id> and the tenant ID → <your-tenant-id>. Paste it into a Compose action. The @{...} tokens are evaluated by Power Automate at run time.

<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<style>@media only screen and (max-width:700px){.stack{display:block!important;width:100%!important;box-sizing:border-box;}.hide-sm{display:none!important;}.pad-sm{padding-left:14px!important;padding-right:14px!important;}.sec-sm{padding-left:10px!important;padding-right:10px!important;}.scroll-sm{display:block!important;width:calc(100vw - 42px)!important;max-width:calc(100vw - 42px)!important;overflow-x:auto!important;-webkit-overflow-scrolling:touch;}}</style></head>
<body style="margin:0;padding:0;background:#EEF2F8;">
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="background:#EEF2F8;"><tr><td align="center" style="padding:20px 10px;">
<!--[if mso]><table role="presentation" width="1040" cellpadding="0" cellspacing="0" border="0"><tr><td><![endif]-->
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="max-width:1040px;width:100%;background:#FFFFFF;border:1px solid #DCE3EE;border-radius:12px;">

<!-- SECTION A: HEADER -->
<tr><td style="background:#0B2A5B;border-radius:12px 12px 0 0;padding:0;">
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0"><tr>
<td width="76" valign="middle" class="hide-sm" style="padding:22px 0 22px 28px;">
<table role="presentation" cellpadding="0" cellspacing="0" border="0"><tr><td width="54" height="54" align="center" valign="middle" style="background:#0F6CBD;border-radius:12px;font-size:28px;line-height:54px;">&#128197;</td></tr></table></td>
<td valign="middle" class="pad-sm" style="padding:22px 20px;font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;">
<div style="font-size:24px;line-height:30px;font-weight:700;color:#FFFFFF;"><span style="color:#FF8A80;">Action Required:</span> Review Upcoming &amp; Overdue Planner Tasks</div>
<div style="font-size:14px;line-height:20px;color:#C7D7F2;padding-top:4px;">Microsoft Planner &ndash; Task Review &amp; Follow-Up</div></td>
<td width="190" valign="middle" align="right" class="hide-sm" style="padding:22px 28px 22px 0;">
<table role="presentation" cellpadding="0" cellspacing="0" border="0"><tr>
<td width="38" height="38" align="center" valign="middle" style="background:#31752F;border-radius:8px;font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:21px;font-weight:700;color:#FFFFFF;line-height:38px;">P</td>
<td style="padding-left:10px;font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:15px;line-height:18px;color:#FFFFFF;font-weight:600;">Microsoft<br>Planner</td></tr></table></td>
</tr></table>
<div style="height:4px;line-height:4px;font-size:0;background:#0F6CBD;">&nbsp;</div></td></tr>

<!-- SECTION B: GREETING -->
<tr><td class="pad-sm" style="padding:24px 28px 8px 28px;font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;">
<div style="font-size:17px;font-weight:700;color:#111827;">Hi Ravi,</div>
<div style="font-size:14px;line-height:21px;color:#374151;padding-top:6px;">Please review the Planner tasks that are overdue or still open, and take the necessary action.</div></td></tr>

<!-- SECTION C: SUMMARY CARDS -->
<tr><td style="padding:12px 22px 6px 22px;">
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0"><tr>
<td class="stack" width="25%" valign="top" style="padding:0 6px 12px 6px;"><table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="background:#FEF3F3;border:1px solid #F7D4D4;border-radius:10px;"><tr><td width="58" valign="middle" style="padding:16px 0 16px 16px;"><table role="presentation" cellpadding="0" cellspacing="0" border="0"><tr><td width="44" height="44" align="center" valign="middle" style="background:#FAD4D4;border-radius:10px;font-size:22px;line-height:44px;">&#9888;&#65039;</td></tr></table></td><td valign="middle" style="padding:14px 14px 14px 12px;font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;"><div style="font-size:30px;line-height:34px;font-weight:700;color:#0B2A5B;">@{outputs('Overdue_Count')}</div><div style="font-size:13px;color:#374151;">Overdue Tasks</div></td></tr></table></td>
<td class="stack" width="25%" valign="top" style="padding:0 6px 12px 6px;"><table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="background:#F2F7FE;border:1px solid #D3E3F8;border-radius:10px;"><tr><td width="58" valign="middle" style="padding:16px 0 16px 16px;"><table role="presentation" cellpadding="0" cellspacing="0" border="0"><tr><td width="44" height="44" align="center" valign="middle" style="background:#D6E6FB;border-radius:10px;font-size:22px;line-height:44px;">&#128198;</td></tr></table></td><td valign="middle" style="padding:14px 14px 14px 12px;font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;"><div style="font-size:30px;line-height:34px;font-weight:700;color:#0B2A5B;">@{outputs('Upcoming_Count')}</div><div style="font-size:13px;color:#374151;">Upcoming Tasks</div><div style="font-size:11px;color:#6B7280;padding-top:1px;">(Next 7 Days)</div></td></tr></table></td>
<td class="stack" width="25%" valign="top" style="padding:0 6px 12px 6px;"><table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="background:#F4F6FD;border:1px solid #DCE1F2;border-radius:10px;"><tr><td width="58" valign="middle" style="padding:16px 0 16px 16px;"><table role="presentation" cellpadding="0" cellspacing="0" border="0"><tr><td width="44" height="44" align="center" valign="middle" style="background:#DCE1F7;border-radius:10px;font-size:22px;line-height:44px;">&#128203;</td></tr></table></td><td valign="middle" style="padding:14px 14px 14px 12px;font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;"><div style="font-size:30px;line-height:34px;font-weight:700;color:#0B2A5B;">@{length(body('Filter_array_(Open_tasks)'))}</div><div style="font-size:13px;color:#374151;">Total Open Tasks</div><div style="font-size:11px;color:#6B7280;padding-top:1px;">All incomplete tasks in plan</div></td></tr></table></td>
<td class="stack" width="25%" valign="top" style="padding:0 6px 12px 6px;"><table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="background:#F1FAF4;border:1px solid #D2ECD9;border-radius:10px;"><tr><td width="58" valign="middle" style="padding:16px 0 16px 16px;"><table role="presentation" cellpadding="0" cellspacing="0" border="0"><tr><td width="44" height="44" align="center" valign="middle" style="background:#D3F0DC;border-radius:10px;font-size:22px;line-height:44px;">&#9989;</td></tr></table></td><td valign="middle" style="padding:14px 14px 14px 12px;font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;"><div style="font-size:30px;line-height:34px;font-weight:700;color:#0B2A5B;">@{length(body('Filter_array_(Completed_last_7_days)'))}</div><div style="font-size:13px;color:#374151;">Completed</div><div style="font-size:11px;color:#6B7280;padding-top:1px;">(Last 7 Days)</div></td></tr></table></td>
</tr></table></td></tr>

<!-- SECTION D: OVERDUE -->
<tr><td style="padding:8px 28px 0 28px;"><table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="background:#FDECEC;border:1px solid #F4C7C7;border-bottom:0;border-radius:8px 8px 0 0;"><tr><td style="padding:12px 16px;font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:17px;font-weight:700;color:#A4262C;">&#9888;&#65039;&nbsp;&nbsp;Overdue Tasks <span style="font-weight:400;">(Action Required)</span></td></tr></table></td></tr>
<tr><td class="sec-sm" style="padding:0 28px 18px 28px;"><div class="scroll-sm" style="background:#FFF7F7;border:1px solid #F4C7C7;border-top:0;border-radius:0 0 8px 8px;padding:0;overflow-x:auto;">@{if(equals(length(variables('TasksArray')),0),'<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="border:1px dashed #C9D3E3;background:#FFFFFF;"><tr><td style="padding:22px;text-align:center;font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;"><div style="font-size:22px;line-height:28px;">&#9989;</div><div style="font-size:14px;font-weight:700;color:#1F2937;padding-top:4px;">No overdue tasks</div><div style="font-size:12px;color:#6B7280;padding-top:2px;">Great work &ndash; nothing is past its due date.</div></td></tr></table>',concat('<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="border-collapse:collapse;border:1px solid #D5DCE8;"><tr><th style="padding:10px 14px;font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px;font-weight:700;color:#FFFFFF;text-align:left;background:#0B2A5B;border-right:1px solid #1E3F77;text-align:center;width:48px;">No.</th><th style="padding:10px 14px;font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px;font-weight:700;color:#FFFFFF;text-align:left;background:#0B2A5B;border-right:1px solid #1E3F77;">Bucket Name</th><th style="padding:10px 14px;font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px;font-weight:700;color:#FFFFFF;text-align:left;background:#0B2A5B;border-right:1px solid #1E3F77;">Task Name</th><th style="padding:10px 14px;font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px;font-weight:700;color:#FFFFFF;text-align:left;background:#0B2A5B;border-right:1px solid #1E3F77;">Assigned To</th><th style="padding:10px 14px;font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px;font-weight:700;color:#FFFFFF;text-align:left;background:#0B2A5B;border-right:1px solid #1E3F77;border-right:0;">Overdue Date</th></tr>',join(body('Select_Overdue_Rows'),''),'</table>'))}</div></td></tr>

<!-- SECTION E: UPCOMING -->
<tr><td style="padding:8px 28px 0 28px;"><table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="background:#E8F1FC;border:1px solid #C7DBF5;border-bottom:0;border-radius:8px 8px 0 0;"><tr><td style="padding:12px 16px;font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:17px;font-weight:700;color:#0B4A8B;">&#128198;&nbsp;&nbsp;Upcoming Tasks &ndash; Due in Next 7 Days</td></tr></table></td></tr>
<tr><td class="sec-sm" style="padding:0 28px 18px 28px;"><div class="scroll-sm" style="background:#F7FAFE;border:1px solid #C7DBF5;border-top:0;border-radius:0 0 8px 8px;padding:0;overflow-x:auto;">@{if(equals(length(variables('TasksArray2')),0),'<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="border:1px dashed #C9D3E3;background:#FFFFFF;"><tr><td style="padding:22px;text-align:center;font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;"><div style="font-size:22px;line-height:28px;">&#128198;</div><div style="font-size:14px;font-weight:700;color:#1F2937;padding-top:4px;">No tasks due in the next 7 days</div><div style="font-size:12px;color:#6B7280;padding-top:2px;">There are no open tasks with a due date in the coming week.</div></td></tr></table>',concat('<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="border-collapse:collapse;border:1px solid #D5DCE8;"><tr><th style="padding:10px 14px;font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px;font-weight:700;color:#FFFFFF;text-align:left;background:#0B2A5B;border-right:1px solid #1E3F77;text-align:center;width:48px;">No.</th><th style="padding:10px 14px;font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px;font-weight:700;color:#FFFFFF;text-align:left;background:#0B2A5B;border-right:1px solid #1E3F77;">Bucket Name</th><th style="padding:10px 14px;font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px;font-weight:700;color:#FFFFFF;text-align:left;background:#0B2A5B;border-right:1px solid #1E3F77;">Task Name</th><th style="padding:10px 14px;font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px;font-weight:700;color:#FFFFFF;text-align:left;background:#0B2A5B;border-right:1px solid #1E3F77;">Assigned To</th><th style="padding:10px 14px;font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px;font-weight:700;color:#FFFFFF;text-align:left;background:#0B2A5B;border-right:1px solid #1E3F77;border-right:0;">Due Date</th></tr>',join(body('Select_Upcoming_Rows'),''),'</table>'))}</div></td></tr>

<!-- SECTION F: ACTION REQUESTED -->
<tr><td style="padding:4px 28px 20px 28px;">
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="background:#F2F6FC;border:1px solid #D3E0F2;border-left:5px solid #0F6CBD;border-radius:8px;"><tr>
<td class="stack" valign="top" style="padding:18px 20px;font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;">
<div style="font-size:16px;font-weight:700;color:#0B2A5B;padding-bottom:6px;">&#127919;&nbsp;Action Requested:</div>
<table role="presentation" cellpadding="0" cellspacing="0" border="0" style="font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:14px;line-height:22px;color:#374151;">
<tr><td valign="top" style="padding-right:8px;color:#0F6CBD;">&#9679;</td><td>Review the tasks listed above.</td></tr>
<tr><td valign="top" style="padding-right:8px;color:#0F6CBD;">&#9679;</td><td>Update the status in Microsoft Planner.</td></tr>
<tr><td valign="top" style="padding-right:8px;color:#0F6CBD;">&#9679;</td><td>Take necessary actions to close or reassign tasks, if required.</td></tr>
</table></td>
<td class="stack" valign="middle" align="right" style="padding:18px 22px;">
<table role="presentation" cellpadding="0" cellspacing="0" border="0"><tr>
<td align="center" bgcolor="#0F6CBD" style="background:#0F6CBD;border-radius:6px;">
<!--[if mso]><v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" href="https://planner.cloud.microsoft/ui/web/plan/<your-plan-id>/view/board?tid=<your-tenant-id>" style="height:46px;v-text-anchor:middle;width:260px;" arcsize="12%" stroke="f" fillcolor="#0F6CBD"><center style="color:#FFFFFF;font-family:Segoe UI,Arial,sans-serif;font-size:15px;font-weight:bold;">Open in Microsoft Planner &#8599;</center></v:roundrect><![endif]-->
<!--[if !mso]><!--><a href="https://planner.cloud.microsoft/ui/web/plan/<your-plan-id>/view/board?tid=<your-tenant-id>" target="_blank" style="display:inline-block;padding:13px 28px;font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:15px;font-weight:700;color:#FFFFFF;text-decoration:none;border-radius:6px;background:#0F6CBD;">Open in Microsoft Planner &#8599;</a><!--<![endif]-->
</td></tr></table></td></tr></table></td></tr>

<!-- SECTION G: FOOTER -->
<tr><td style="padding:0 28px;"><div style="height:1px;line-height:1px;font-size:0;background:#E5E9F0;">&nbsp;</div></td></tr>
<tr><td style="padding:16px 28px 22px 28px;">
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0"><tr>
<td class="stack" valign="top" style="font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:14px;line-height:20px;color:#374151;">Regards,<br><b style="color:#111827;">MS Planner</b></td>
<td class="stack" valign="bottom" align="right" style="font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:12px;line-height:18px;color:#6B7280;font-style:italic;">&#9432;&nbsp;This is an automated reminder from Microsoft Planner. Please keep task status up to date.</td>
</tr></table></td></tr>
</table>
<!--[if mso]></td></tr></table><![endif]-->
</td></tr></table></body></html>

Appendix B: Complete Select Row Expressions

Both Select actions are used in text mode: the From field takes an expression and the Map field takes a single expression (no key/value pairs). The select values below are exactly as deployed, and contain the invisible comma + zero-width space + space separator inside the replace() that builds assignee chips.

Select_Overdue_Rows

{
 "from": "@range(0, length(variables('TasksArray')))",
 "select": "@concat('<tr style=\"background:',if(equals(mod(item(),2),1),'#F7F9FC','#FFFFFF'),';\"><td style=\"padding:9px 14px;border-bottom:1px solid #E3E8F0;font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px;color:#1F2937;text-align:center;color:#6B7280;width:48px;\">',string(add(item(),1)),'</td><td style=\"padding:9px 14px;border-bottom:1px solid #E3E8F0;font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px;color:#1F2937;\">',replace(replace(replace(string(variables('TasksArray')[item()]?['Bucket Name']),'&','&amp;'),'<','&lt;'),'>','&gt;'),'</td><td style=\"padding:9px 14px;border-bottom:1px solid #E3E8F0;font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px;color:#1F2937;font-weight:600;\">',replace(replace(replace(string(variables('TasksArray')[item()]?['Task Name']),'&','&amp;'),'<','&lt;'),'>','&gt;'),'</td><td style=\"padding:9px 14px;border-bottom:1px solid #E3E8F0;font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px;color:#1F2937;\"><span style=\"display:inline-block;padding:2px 9px;margin:1px 2px 1px 0;border-radius:11px;background:#EEF2FA;color:#1E3A6E;font-size:12px;white-space:nowrap;\">',replace(replace(replace(replace(string(variables('TasksArray')[item()]?['Assigned To']),'&','&amp;'),'<','&lt;'),'>','&gt;'),',​ ','</span> <span style=\"display:inline-block;padding:2px 9px;margin:1px 2px 1px 0;border-radius:11px;background:#EEF2FA;color:#1E3A6E;font-size:12px;white-space:nowrap;\">'),'</span></td><td style=\"padding:9px 14px;border-bottom:1px solid #E3E8F0;font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px;color:#1F2937;background:#FDECEC;color:#C50F1F;font-weight:700;white-space:nowrap;\">&#128197;&nbsp;',string(variables('TasksArray')[item()]?['Overdue Date']),'</td></tr>')"
}

Select_Upcoming_Rows

{
 "from": "@range(0, length(variables('TasksArray2')))",
 "select": "@concat('<tr style=\"background:',if(equals(mod(item(),2),1),'#F7F9FC','#FFFFFF'),';\"><td style=\"padding:9px 14px;border-bottom:1px solid #E3E8F0;font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px;color:#1F2937;text-align:center;color:#6B7280;width:48px;\">',string(add(item(),1)),'</td><td style=\"padding:9px 14px;border-bottom:1px solid #E3E8F0;font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px;color:#1F2937;\">',replace(replace(replace(string(variables('TasksArray2')[item()]?['Bucket Name']),'&','&amp;'),'<','&lt;'),'>','&gt;'),'</td><td style=\"padding:9px 14px;border-bottom:1px solid #E3E8F0;font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px;color:#1F2937;font-weight:600;\">',replace(replace(replace(string(variables('TasksArray2')[item()]?['Task Name']),'&','&amp;'),'<','&lt;'),'>','&gt;'),'</td><td style=\"padding:9px 14px;border-bottom:1px solid #E3E8F0;font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px;color:#1F2937;\"><span style=\"display:inline-block;padding:2px 9px;margin:1px 2px 1px 0;border-radius:11px;background:#EEF2FA;color:#1E3A6E;font-size:12px;white-space:nowrap;\">',replace(replace(replace(replace(string(variables('TasksArray2')[item()]?['Assigned To']),'&','&amp;'),'<','&lt;'),'>','&gt;'),',​ ','</span> <span style=\"display:inline-block;padding:2px 9px;margin:1px 2px 1px 0;border-radius:11px;background:#EEF2FA;color:#1E3A6E;font-size:12px;white-space:nowrap;\">'),'</span></td><td style=\"padding:9px 14px;border-bottom:1px solid #E3E8F0;font-family:Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px;color:#1F2937;white-space:nowrap;',if(lessOrEquals(div(sub(ticks(parseDateTime(variables('TasksArray2')[item()]?['Due Date'],'en-US','dd-MMM-yyyy')),ticks(startOfDay(utcNow()))),864000000000),2),'color:#B45309;font-weight:700;background:#FFF4E0;','color:#1F2937;'),'\">&#128197;&nbsp;',string(variables('TasksArray2')[item()]?['Due Date']),if(lessOrEquals(div(sub(ticks(parseDateTime(variables('TasksArray2')[item()]?['Due Date'],'en-US','dd-MMM-yyyy')),ticks(startOfDay(utcNow()))),864000000000),0),'&nbsp;<span style=\"display:inline-block;padding:1px 7px;border-radius:9px;background:#F59E0B;color:#FFFFFF;font-size:11px;font-weight:700;\">Due today</span>',if(equals(div(sub(ticks(parseDateTime(variables('TasksArray2')[item()]?['Due Date'],'en-US','dd-MMM-yyyy')),ticks(startOfDay(utcNow()))),864000000000),1),'&nbsp;<span style=\"display:inline-block;padding:1px 7px;border-radius:9px;background:#F59E0B;color:#FFFFFF;font-size:11px;font-weight:700;\">Due tomorrow</span>',if(equals(div(sub(ticks(parseDateTime(variables('TasksArray2')[item()]?['Due Date'],'en-US','dd-MMM-yyyy')),ticks(startOfDay(utcNow()))),864000000000),2),'&nbsp;<span style=\"display:inline-block;padding:1px 7px;border-radius:9px;background:#F59E0B;color:#FFFFFF;font-size:11px;font-weight:700;\">In 2 days</span>',''))),'</td></tr>')"
}

Built and deployed on Power Automate (cloud flows) using the Planner, Office 365 Groups and Office 365 Outlook standard connectors. Test figures quoted in this article come from a single verification run and are illustrative only.

Share