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
- Add the one new column to the existing SharePoint list (see below).
- Open Power Apps Studio → New blank canvas app (tablet landscape, 1366×768).
- Add the data connection listed below.
- Set App → OnStart using the code block below.
- 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
| Column name | Type | Notes |
|---|---|---|
DateCompleted | Date 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. |
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"
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.
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.
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.
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.
Read-only archive of records marked complete more than 7 days ago. Tap a row to view the full record.
Paste Order
- Create 4 blank screens in Power Apps (they can be named anything — the YAML renames them on paste).
- Click the first blank screen, open the three-dot menu, choose Paste YAML.
- Repeat for each screen in order: Dashboard, Record, Add, Archive.
- Set the startup screen to
scrDashboardin App → StartScreen.
Issues
Found a problem or need a change? Report it in the issues tracker.