← Guide Library

Staff Movements v2.6

Built 24 Jun 2026 04:32 BST

Canvas app — tracks staff joining and leaving the branch. Four tab views (All / Admin / IX / IM), per-duty Set Today buttons, and a leaver lifecycle workflow. Wraps the existing Staff Movements SharePoint list.

Before You Start

  1. Add the one new column to the existing SharePoint list (see below).
  2. Open Power Apps Studio → New blank canvas app (tablet landscape, 1366×768).
  3. Add the data connection listed below.
  4. Set App → OnStart using the code block below.
  5. Create 4 blank screens, then paste each YAML in order.

Data Connection

Add this in the Data panel before pasting any YAML:

SharePoint List Changes

The existing Staff Movements list is used as-is. One new column must be added:

List: Staff Movements existing

This list already exists. Do not recreate it. Only add the one new column below.
Column nameTypeNotes
DateCompletedDate and Time (Date Only)ADD THIS No space in name. Not Required. Used to calculate the 7-day archive window.
All other columnsLeave as-is. The app uses internal column names directly from the schema.
Column name gotchas: Some columns have URL-encoded internal names due to special characters in the original names. The app uses these internal names exactly as they appear in SharePoint: If any of these Patch calls fail with a field-not-found error, check the actual internal name in the SharePoint list settings and update the formula.

App.OnStart

Paste into App → OnStart in Power Apps Studio. Do not put this inside any screen.

// Staff Movements — App.OnStart
// ─────────────────────────────────────────────────────────────
// TAB EMAIL MAPPINGS  (edit these three strings to reassign tabs)
//   IX    = Allan Hamilton   (allan.hamilton775@mod.gov.uk)
//   IM    = Dan Smith        (dan.smith391@mod.gov.uk)
//   Admin = Jackie Bishop    (jackie.bishop133@mod.gov.uk)
//   Anyone else falls through to "All" — the neutral, unprivileged view.
//   varTab only ever picks which "pending duties" column is highlighted on
//   the dashboard; it grants no extra access on its own. Real access control
//   is the SharePoint list permissions, locked to the three names above. But
//   an unrecognised user should never be silently handed the "Admin" tab by
//   default, so the fallback here is deliberately "All", not "Admin".
// ─────────────────────────────────────────────────────────────
Set(varMyEmail, Lower(User().Email));
Set(
    varTab,
    Switch(
        varMyEmail,
        "allan.hamilton775@mod.gov.uk", "IX",
        "dan.smith391@mod.gov.uk",      "IM",
        "jackie.bishop133@mod.gov.uk",  "Admin",
        "All"
    )
);
Set(varSelectedRecord, Blank());
Set(varShowEditPanel, false);
Set(varShowLeaverPanel, false);
Set(varErrEditTitle, false);
Set(varErrEditMovType, false);
Set(varErrAddTitle, false);
Set(varErrAddMovType, false);
ClearCollect(colMovements, 'Staff Movements (LTD)')

Screens

Create a new blank screen for each one, then paste in this order. Each screen imports as a complete unit.

Screen 1
scrDashboard
v2.3: the "pending duties" and Complete/Active tags in the movement list are now real rounded pills (a filled, radius'd button sitting behind a transparent label) instead of flat-cornered coloured rectangles — Labels can't take a radius in Power Apps, so any "badge" built from a Label alone is always going to look like a square block. v2.2: pending-duties counts realigned to match scrRecord's Admin/IX/IM grouping.
Open and copy →
Screen 2
scrRecord
v2.6: the stage tab bar is now a real numbered-circle stepper (filled/outlined circles, connecting lines that fill in as you progress, checkmarks on completed stages) instead of three flat rectangular tab buttons — same visual language as the concept artifact. Movement Type and Complete badges are now proper rounded pills too — a filled, radius'd button behind a transparent label, since Labels can't take a radius in Power Apps. v2.5: swapped every date field to the rounded DatePicker@0.0.46 control, away from the flat square Classic/DatePicker. v2.4: fixed Start/Leaving Date showing simultaneously. v2.0: rebuilt as a 3-stage wizard.
Open and copy →
Screen 3
scrAdd
v1.13: same date-picker swap as scrRecord (rounded DatePicker@0.0.46, not the flat Classic boxes). Still the old pre-wizard styling otherwise — not yet brought in line with the new look. Add a new movement record: name, movement type, position, staff number, role, start date, notes.
Open and copy →
Screen 4
scrArchive
Read-only archive of records marked complete more than 7 days ago. Tap a row to view the full record.
Open and copy →

Paste Order

  1. Create 4 blank screens in Power Apps (they can be named anything — the YAML renames them on paste).
  2. Click the first blank screen, open the three-dot menu, choose Paste YAML.
  3. Repeat for each screen in order: Dashboard, Record, Add, Archive.
  4. Set the startup screen to scrDashboard in App → StartScreen.
Tab auto-detection: The app auto-selects the IX or IM tab based on the logged-in user's email. To change mappings, edit the two email strings in App.OnStart. To add a third named user, add another line to the Switch statement.
Movement Type options in the app: "New to MoD/Branch", "Moving to Branch", "Leaving Branch", "Leaving MoD". If your SharePoint list has different Choice option strings, update the dropdown Items lists in scrAdd and scrRecord to match exactly.

Issues

Found a problem or need a change? Report it in the issues tracker.

Leave a note for Claude — Staff Movements

Saved into the shared locked storage bucket only Claude can read — not public. Auto-deletes after 14 days.