Skip to content
Tutorials Center
My learning

Topics

Lesson 38 of 38 ยท Projects and Practice

Practice Scenarios and Design Exercises

Test your Power Automate design skills with eight realistic scenarios on approvals, loops, desktop flows, error handling and governance, each with hints and a model answer outline.

Knowing the actions is half the skill; the other half is choosing the right design for a messy request. This lesson gives you eight scenarios of the kind you meet at work. For each one, try to sketch your own solution first (on paper, as a list of triggers, actions and settings), then compare it with the outline. There is rarely one right answer, so judge yours by the questions at the end: does it handle failure, repeats, limits and security?

Nothing here needs the product. A runnable stand-in at the end helps you self-check a design against a small rubric.

How to work through a scenario

  1. Write the trigger and the data you need.
  2. List the decisions (conditions, approvals).
  3. List the repeated work (loops) and whether a data operation could replace it.
  4. Add the failure story: what can fail, who is told, what is cleaned up.
  5. Check repeats, limits, licensing and governance.

Scenario 1: Leave requests

Employees submit leave in a Microsoft Form. The manager approves; HR is informed for requests over 5 days; approved leave is added to a shared calendar. If the manager does not answer in 3 days, remind; after 5 days, escalate to the department head.

Hints: the form trigger needs a second action to read the response; use the two-action approval form and a parallel branch for reminders; lookup of the manager via the Users connector.

Outline: Forms trigger, Get response details, Compose days from the dates, Create an approval, a delay branch with Do until, Wait for an approval, Condition on Outcome, Condition on days over 5 to email HR, Create calendar event, notify employee. Catch scope alerts the owners (approvals, Do until).

Scenario 2: Weekly overdue report

Every Monday at 08:00, email each project manager a table of their own overdue tasks from a SharePoint list of 8,000 items.

Hints: server-side filter, then group by manager, one email per manager, avoid a loop over all 8,000 items.

Outline: Recurrence trigger; Get items with Filter Query Status ne 'Done' and DueDate lt '@{utcNow()}' and pagination on; Select the manager email into an array and remove duplicates with union(); Apply to each manager (limited concurrency); Filter array for that manager's tasks; Create HTML table; Send email (loops, patterns).

Scenario 3: Order status by size

An order flow routes orders: under 50 units go to the warehouse queue, 50 to 500 to a team lead, over 500 to purchasing, plus any order for a restricted product needs compliance sign-off.

Hints: a computed category and a Switch; the restricted flag is a second test.

Outline: Compose size with a nested if; Switch on it; Condition on restricted before the Switch; a Default case logs unknown values (conditions and switch).

Scenario 4: Legacy HR system

New hires are listed in an Excel file on a shared drive each Friday. The HR application has no API. Create the accounts in it.

Hints: the cloud flow detects the file; the desktop flow reads and types; failures need a screenshot; the same file may be dropped twice.

Outline: File trigger, record the file name in a log to avoid reprocessing, call the desktop flow in unattended mode with the file path; the desktop flow reads with the Excel actions, loops over rows, validates each, types it in, writes a status column back; Catch writes the screenshot path in an alert (desktop flows, data).

Scenario 5: The flaky partner API

A flow posts orders to a partner API that sometimes returns 503 or takes two minutes. Orders must not be duplicated and the partner allows 10 calls per second.

Hints: retry policy, timeouts, idempotency key, concurrency limit.

Outline: HTTP action with an exponential retry policy (count about 4), timeout PT3M, an Idempotency-Key header from the order number, loop concurrency 5, Catch that flags the order NeedsAttention (retry policies).

Scenario 6: Blocked by policy

A developer's flow copies a SharePoint file to a personal cloud storage service and is suspended with a data policy violation. What do you advise?

Hints: do not suggest bypassing the policy.

Outline: explain the Business versus Non-business rule; propose OneDrive for Business or the approved external sharing method; if a real business need exists, request a policy exception or an environment with a suitable policy through the admin; keep the data inside governed connectors (DLP).

Scenario 7: Shipping to production

A flow built in the Default environment by one employee is now business-critical. The employee is leaving next month. What do you do?

Outline: create a solution in a Dev environment, add the flow, replace hard-coded values with environment variables and connections with connection references, assign a team or service principal as owner, export managed, import into Production, test, retire the original, document (environments and solutions).

Scenario 8: Debugging at 9 a.m.

Monday morning: a nightly flow shows Succeeded but yesterday's output list is empty. Nothing is red in the run history.

Hints: a quiet success usually means a branch or a loop did not run.

Outline: open the run; check whether the trigger found items (filter query returned zero?), whether a Condition took the unexpected branch, whether Do until hit its limit without an error, whether a Catch swallowed an error and the run ended Succeeded. Add a heartbeat check and a Terminate Failed in the Catch (monitoring, run after).

Self-check with a rubric

The stand-in below scores a design description against the five questions. Edit the object with your own answers to see what is missing. It is a thinking aid, not a real tool.

JS Stand-in: design rubric

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Expression cheat sheet

TEXT
@utcNow()                                         current time (UTC)
@addDays(utcNow(), -7, 'yyyy-MM-dd')              a week ago
@coalesce(triggerBody()?['Note'], 'none')         default for null
@if(empty(x), 'a', 'b')                           inline condition
@length(body('Filter_array'))                     count matches
@first(body('Filter_array'))                      first match
@join(body('Select'), ', ')                       list to text
@concat('Invoice ', variables('Number'))          join text
@workflow()?['run']?['name']                      current run id
@result('Try')                                    results of a scope

Check your understanding

Quick check ยท 3 questions

of 3 answered You scored / 3 ยท perfect!

  1. 1. A flow shows Succeeded but did nothing. Which is a likely cause?

    Limits and handled errors do not turn the run red, so check branches, loops and Catch scopes.
  2. 2. For 8,000 list items where you need only overdue ones, what is the best first step?

    Filter early on the server.
  3. 3. A suspended flow reports a data policy violation. What is the right response?

    Work within governance; escalate legitimate needs through the proper channel.

Summary

  • Work through scenarios with a fixed routine: trigger and data, decisions, loops, failure, then repeats, limits, security and governance.
  • Prefer server filters and data operations over big loops; combine run after, timeouts, retries and idempotency for resilience.
  • Quiet successes are caused by skipped branches, loop limits and swallowed errors; monitor for missing output.
  • Ship important flows in solutions with variables, connection references and more than one owner.

Next: Back to the Power Automate course