v2.6 Built 24 Jun 2026 📋 Screen YAML Vault →

Staff Movements

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 → connect to your SharePoint site → select Staff Movements

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 columns—Leave 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:
  • Add_x0020_to_x0020_ACOS_x0020_Ex — displays as "Added/Removed Branch Execs Invites"
  • Upgrade_x0020_M365_x0020_License — displays as "Upgrade M365 License"
  • What_0Mailboxes — displays as "What 0Mailboxes are required?"
  • Staff_x002f_ServiceNo — displays as "Staff/Service No or PUID"
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.

v2.6 — Updated 24 Jun 2026 04:32 BST
// 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.

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.