← Guide Library

Policy Tracker V3.7

Built 15 Aug 2026 — v3.7: NewsletterPack now drafts the weekly Thursday Batch 1/2 emails directly via the Office 365 Outlook connector's DraftEmail action — bold HTML body built from this week's newsletter items plus a fixed footer, BCC pulled from Branch Contact Groups' BM Groups/BM Memberships SharePoint lists (per-user identity, no shared connection). Requires those two lists added as data sources before pasting. Manual step still required: paste this week's release link into the placeholder in the drafted body, and set the OFFICIAL sensitivity label before sending.

Canvas app tracking ACCT UK policy documents through the release pipeline. V2 is a complete redesign: dominant type-colour card panels, segmented type filter, inline search, owner initials circles, status dots, Newsletter Pack screen, and a new cool-grey palette throughout. Wraps the Policy Proof Tracker SharePoint list with a PolicyLinks child list.

Build Progress

OnStart
✓ V2 ready
Main
✓ V2 ready
Overview
✓ V2 ready
Historic
V3 (old)
ViewItem
✓ V2 ready
Newsletter Pack
✓ V3.4 ready
StartScreen
Unchanged

Before You Start

  1. Verify your SharePoint list columns match the table below (no new columns needed for V2).
  2. Open Power Apps Studio → New blank canvas app (tablet landscape, 1366×768).
  3. Add all three data connections listed below.
  4. Set App → OnStart using the code block below — copy and paste the whole thing.
  5. Create 6 blank screens, then paste each YAML in order (see Screens section).
  6. Set the startup screen to StartScreen in App → StartScreen.

Data Connections

Add these in the Data panel before pasting any screen YAML:

SharePoint Column Reference

No new columns are required for V2. These internal names are used across the YAML — check them in SharePoint list settings if any Patch calls fail.

Internal name gotchas: The display name in SharePoint may differ from the internal name used in formula code:

App.OnStart

Paste into App → OnStart in Power Apps Studio. Do not put this inside any screen YAML. Run it once after pasting to populate all collections before using any screen.

Newsletter access: To grant a user access to the Newsletter Pack screen, add a row to colNewsletterUsers in the OnStart block below. No other change is needed anywhere in the app.
// App.OnStart — Policy Tracker V2
// Paste into App → OnStart in Power Apps Studio (not a screen YAML)

// ── State variables ──────────────────────────────────────────────────────────
Set(varSelectedState, "Current");
Set(varShowSearch, false);
Set(varSelectPolicy, "Empty");
Set(varHistoricLimit, 28);
Set(varSelectedDate, Today());
Set(varSelectedItem, Blank());
Set(varSelectedRelease, Blank());
Set(varSelectedLink, Blank());
Set(varShowDuplicateModal, false);
Set(varSaving, false);
Set(varUnsavedChanges, false);
Set(varParentSaved, false);
Set(varLoadingLinks, false);
Set(varFormSaved, false);
Set(varDeletingItem, false);
Set(varSaveMode, "");
Set(varDuplicating, false);
Set(varShowLinkModal, false);
Set(varShowMyEntries, false);
Set(varScrollDate, Blank());
Set(varSourceScreen, "Main");
Set(varDeepLinkHandled, false);
Set(varLoading, false);
Set(gblMorphTimestamp, Text(Now(), "yyyymmddhhmmss"));

// ── V2 additions ─────────────────────────────────────────────────────────────
Set(varTypeFilter, "All");
Set(varSearchText, "");
Set(varNextThursday, DateAdd(Today(), Mod(5 - Weekday(Today()) + 7, 7), "Days"));

// ── Newsletter access list (add rows here to grant access) ───────────────────
ClearCollect(
    colNewsletterUsers,
    {Email: "allan.hamilton775@mod.gov.uk"},
    {Email: "dan.smith391@mod.gov.uk"}
);

// ── Document type colour map (V2 palette) ─────────────────────────────────────
ClearCollect(
    colChoiceColors,
    ForAll(
        Choices('Policy Proof Tracker'.'Document Type'),
        {
            ChoiceValue: Value,
            ColorCode: Switch(
                Value,
                "📄 MoD Policy",        RGBA(28, 32, 48, 1),
                "MoD Policy",           RGBA(28, 32, 48, 1),
                "📄 ACSO",              RGBA(20, 60, 140, 1),
                "ACSO",                 RGBA(20, 60, 140, 1),
                "📖 Regulation",        RGBA(0, 130, 140, 1),
                "Regulation",           RGBA(0, 130, 140, 1),
                "📄 CFSO",              RGBA(108, 40, 168, 1),
                "CFSO",                 RGBA(108, 40, 168, 1),
                "📄 CFI",               RGBA(56, 96, 178, 1),
                "CFI",                  RGBA(56, 96, 178, 1),
                "📄 CBN",               RGBA(191, 100, 30, 1),
                "CBN",                  RGBA(191, 100, 30, 1),
                "📕 SOI",               RGBA(180, 50, 40, 1),
                "SOI",                  RGBA(180, 50, 40, 1),
                "📑 Internal Document", RGBA(90, 90, 115, 1),
                "Internal Document",    RGBA(90, 90, 115, 1),
                "📗 Manual",            RGBA(46, 125, 89, 1),
                "Manual",               RGBA(46, 125, 89, 1),
                "📜 Newsletter Item",   RGBA(160, 120, 0, 1),
                "Newsletter Item",      RGBA(160, 120, 0, 1),
                RGBA(150, 150, 150, 1)
            )
        }
    )
);

// ── App theme (V2 forest green palette) ──────────────────────────────────────
Set(
    AppTheme,
    {
        palette: {
            themePrimary:   RGBA(46, 125, 89, 1),
            themeSecondary: RGBA(36, 100, 70, 1),
            themeTertiary:  RGBA(28, 80, 55, 1),
            neutralLight:   RGBA(243, 244, 248, 1),
            neutralDark:    RGBA(28, 32, 48, 1),
            white:          RGBA(255, 255, 255, 1)
        },
        semanticColors: {
            buttonBackground:        RGBA(46, 125, 89, 1),
            buttonBackgroundHovered: RGBA(36, 100, 70, 1),
            buttonBackgroundPressed: RGBA(28, 80, 55, 1),
            buttonText:              RGBA(255, 255, 255, 1)
        }
    }
)

Screens

Create a blank screen for each, then paste in the order below. Screens marked V3 (old) still work — paste them while V2 rebuilds are in progress. Replace each one as the V2 version is released.

V3 — unchanged
Screen 1
StartScreen
Deep-link router. Checks for an ID param on launch and routes directly to ViewItem, otherwise navigates to Main. No visible UI.
Open and copy →
✓ V2 ready
Screen 2
Main
Full redesign. 110px dominant type-colour left panel on every card. Segmented 10-button type filter. Inline search. Owner initials circle. Status dot. High Priority amber border. Newsletter Pack button (gated).
Open and copy →
✓ V2 ready
Screen 3
Overview
4-column horizontal Thursday grid. Green header on current week, slate on future weeks. Amber count badge. Compact cards with 6px type bar, owner initials, status dot. Tap navigates to ViewItem.
Open and copy →
V3 — pending V2 rebuild
Screen 4
Historic
Archive view. Table layout with type bar, published/unpublished badge, search, and count footer. Paste the V3 version for now.
Open and copy →
V3.5 — ready
Screen 5
ViewItem
Complete SaaS rebuild. Type-colour hero banner. Left panel (840px scroll): ALL-CAPS labels, custom inputs, conditional sections. Right panel: Save, links gallery, lifecycle card, Duplicate/Delete. No Form/TypedDataCards. Patch() save. Action buttons in content, not header.
Open and copy →
✓ V3.7 ready
Screen 6
Newsletter Pack
Dual-panel screen. Left: plain reference text with Item summary and separators. Right: email-ready bullet preview with Copy All using an indented intended-audience bullet, plus Thursday Batch 1/2 Email buttons that draft an HTML email via the Office 365 Outlook connector (bold titles, BCC pulled from Branch Contact Groups' BM Groups/BM Memberships lists). Requires those two SharePoint lists added as data sources first.
Open and copy →

Test Screens (not yet promoted)

Full redesign in progress, pasted onto new screens (Main_1, ViewItem_1) rather than overwriting the real Main/ViewItem above — safe to test without risking the live screens. Once happy, delete the old screens and rename these to Main/ViewItem.

Test — paste as new screen
Main_1
Main (redesign)
Hero "next release" band, slim segmented dashboard tabs (rose tint only when Issues > 0), data-driven doc-type chip gallery, 3-dot approval stepper on every card, copy-link, per-item + bulk "Mark all as Published" (staff-gated), Release Pipeline sidebar using the real Progress control.
Open and copy →
Test — paste as new screen
Main_2
Main (redesign, take 2)
Rebuilt from Main_1 with every lesson learned baked in from the start (DropShadow: None and FillPortions explicit everywhere, no silent defaults) plus the hand-built segmented tile row replaced with a real ModernTabList control and a small live-counts caption underneath. Header and Card controls deliberately NOT used — verified against Microsoft's own docs to be unfit for this app's action-bar and card-click-target patterns.
Open and copy →
Test — paste as new screen
ViewItem_1
View Item (redesign)
Standalone-control detail screen with top-bar warning swap, compact and full approval steppers, high-priority/top-item gold card states, mint completion states, manual Patch save, and document link cards with add/edit/delete/open actions.
Open and copy →
Test — paste as new screen
Historic_2
Historic Archive (redesign)
Grouped by month with a timeline accent down the left edge, search + type-filter chips moved into the header, rows restyled as cards using the shared colChoiceColors pill (needs the colour-centralization guide applied first for full effect, works standalone too).
Open and copy →
Test — paste as new screen
Overview_2
Overview / "Summary" (redesign + lightbox)
Same 4-week Thursday grid, restyled to match the V2 card language, plus a working click-to-preview lightbox — tap a card to see owner, summary, approval progress, and document links inline without leaving the grid. "Open full entry" hands off to the real ViewItem for editing.
Open and copy →
Test — paste as new screen
NewsletterPack_2
Newsletter Pack (V2 restyle)
Same dual-panel plain-text/email-preview layout, restyled to match the V2 card language: document-type accent bar + pill on every row via colChoiceColors, forest-green primary actions. Also removes the hand-duplicated sort-order Switch flagged in issue #15 — both OnVisible and Refresh now share one LookUp(colChoiceColors, ...) instead of two copies of the same 65-line formula.
Open and copy →

In-Place Rebuild Guides

Targeted build guides for changing the existing screens section by section instead of pasting a whole replacement screen.

Start here — final QA pass
OnStart + Main + ViewItem + Overview + Historic
Final Pass QA
Full read-through of a fresh 6-screen export: 3 dead global variables safe to delete, a possible repeat of the FillPortions bug in Overview's item lightbox, Historic's type chips not in canonical order, plus two informational notes (search delegation limit, a link-loading inconsistency between Historic and Main). Confirms every earlier fix in this project is still correctly in place first.
Open guide →
Start here — everything outstanding, one page
Main + ViewItem + Overview
Pre-Launch Fix List
Current outstanding items only: the invalid deep-link Navigate call likely breaking OnVisible entirely, the Close-button confirm modal wired to the wrong control, Overview's Top Item sort, Consultation Only items never surfacing on Main once their date passes, and the network round-trip causing Owner's visible catch-up delay. Full replacement formulas and a test step for every one.
Open guide →
New build, not yet started
Main + ViewItem
Toast Notifications, Replacing Notify()
Custom toast component (card with accent bar) to replace the built-in Notify() banner, positioned top-left over the logo/title area on Main and ViewItem. Covers why it works correctly across screen navigation, the ShowToast() helper function, the component build for both screens, and real converted examples for Save, Save & Close, and Delete.
Open guide →
New build, not yet started
ViewItem
Dialog Component — Replacing Delete/Discard Modals
One shared cmpEnhancedDialog instance (from powerappsui.com) replaces the three separate confirmation modals on ViewItem — Delete Item, Delete Link, and Discard Unsaved Changes — switching title/message/buttons based on which action opened it. Covers the Component-import verification step, the two new state variables, the full OnButtonSelect dispatch, and retargeting all three trigger buttons.
Open guide →
New build, not yet started
ViewItem
Stepper Component — Replacing the Approval Stepper
Replaces both the compact and full approval steppers with cmpStepper (from powerappsui.com). Flags the one real gap honestly up front — the new component can't recolour a single out-of-sequence dot amber like the current one does — and works around it with a separate warning line driven by the exact same anomaly formula already in use.
Open guide →
New build, not yet started
ViewItem
Loading Overlay — Real Save Feedback
Adds a blurred full-screen overlay with a spinner while saving, wired straight to the existing varSaving variable — no new state, no logic changes, purely visual feedback for a save that was already being tracked invisibly.
Open guide →
New build, not yet started
Multiple
Policy Tracker — Fix Guide
Running fix log, every confirmed fix kept in one page instead of being replaced one at a time. Currently 3 entries: blocking personal OneDrive document links, fixing the "Save failed / Invalid URL value" crash on long address-bar-copied links, and a hint label explaining the generic-icon limitation on those links.
Open guide →
New build, not yet started
Multiple
Cleanup Pass — Delegation Fix, Formula Dedup, Real Data-Gated Loading Screen
Three items in priority order: fixes the same non-delegable Year/Month/Day bug from NewsletterPack, still live in ViewItem's colThursdayOptions (104 filters, not just 3); redesigns StartScreen's branded splash to genuinely wait on RefreshActiveCache() finishing (colActiveItems/colActiveLinks) instead of a fixed cosmetic delay; and dedupes the file-extension logic duplicated across BuildLinksForSource and RefreshActiveCache.
Open guide →
New build, not yet started — biggest guide in this batch
Main + ViewItem
Preload — Instant Due Next 4 Weeks Tab
Preloads every item due in the next 4 weeks, plus every one of their links, in one combined fetch when Main loads — so clicking that tab or opening any of its items is instant, no per-item network round trip. A new RefreshActiveCache() function, changes to Main.OnVisible/HeaderGallery.Items/the Current tab button, a rewrite of ViewItem's link-loading check, and a table of every write path that needs the cache refreshed afterward. States the real trade-off plainly: it won't reflect another session's changes until you switch tabs or reopen.
Open guide →
Guide — new feature
Main
Type Filter Popover
Replaces the always-visible row of 10 coloured type chips with a single button that opens a popover list — same varTypeFilter/colTypeCounts filtering underneath, just tucked away until someone wants it. Approved mockup included.
Open guide →
Guide — new feature
ViewItem
Thursday Date Picker
Replaces the free calendar on Planned Publish Date with a ranked list of upcoming Thursdays — a relative-time label, a "this week's release" tag, and a colour-coded item count per week, so picking a release date further out is easy and nobody can pick a non-Thursday. New entries auto-select the nearest Thursday.
Open guide →
Tier 4 — performance
Main + ViewItem
Final Scrub & Polish
Tiers 1–3 are applied. This version covers what's left: a User Defined Function collapsing the 6x-duplicated link-loading formula into one definition, precomputed type-filter chip counts instead of ~10 full-table scans per render, and a grouped-once Thursday picker instead of 52 re-filters. Full step-by-step with complete replacement formulas for every site.
Open guide →
Guide — edit existing screen
ViewItem
"Copy Title" button next to Newsletter Title
Adds a small button that copies whatever's currently in the main Title field into Title for Newsletter, one click, with an override so the copied value can still be edited afterwards.
Open guide →

Paste Order

  1. Create 6 blank screens in Power Apps Studio (names do not matter — YAML renames them on paste).
  2. Click the first blank screen. Open the three-dot menu on the screen name → Paste YAML.
  3. Paste each screen in order: StartScreen, Main, Overview, Historic, ViewItem, NewsletterPack.
  4. After pasting all screens, set App → StartScreen to StartScreen.
  5. Run App → OnStart once via the “Run OnStart” option to populate all collections.

V2 Design Reference

Colour Palette

TokenRGBAUse
BackgroundRGBA(243, 244, 248, 1)Screen fill, controls row
CardRGBA(255, 255, 255, 1)Gallery cards, stat bar
Primary greenRGBA(46, 125, 89, 1)Buttons, active states, Manual type
ForegroundRGBA(28, 32, 48, 1)Primary text, card titles
MutedRGBA(112, 116, 134, 1)Secondary text, labels, dates
BorderRGBA(28, 32, 48, 0.12)Card borders

Document Type Colours

TypeColourRGBA
MoD PolicyDark slateRGBA(28, 32, 48, 1)
ACSONavyRGBA(20, 60, 140, 1)
RegulationTealRGBA(0, 130, 140, 1)
CFSORich purpleRGBA(108, 40, 168, 1)
CFISteel blueRGBA(56, 96, 178, 1)
CBNAmber orangeRGBA(191, 100, 30, 1)
ManualForest greenRGBA(46, 125, 89, 1)
Newsletter ItemGoldRGBA(160, 120, 0, 1)
SOITerracottaRGBA(180, 50, 40, 1)
Internal DocumentSlate greyRGBA(90, 90, 115, 1)

Sort Priority Order

PriorityTypeNotes
0Top ItemAlways first, regardless of type
1MoD Policy
2ACSO
3Regulation
4CFSO
5CFI
6CBN
7Manual
8Newsletter Item
9SOI
10Internal Document

What Changed in V2

Notes

Pasting V3 screens alongside V2 Main: The V3 Overview, Historic, ViewItem, and StartScreen screens still work with the V2 OnStart. All variables they depend on (varSelectedRelease, varSelectPolicy, colLinks, etc.) are still initialised. You will not see any errors on paste.
Thursday date picker: The Duplicate modal (ViewItem) only offers Thursdays ≥10 days away. Ticking “High Priority” makes closer Thursdays available. Only Thursdays are accepted as release dates — the date picker validates the weekday on change.
Newsletter Pack access: Edit the colNewsletterUsers collection in App.OnStart to add or remove users. The button in the Main header is automatically hidden for users not in the list. No other change needed.
Top Item column note: NewsletterPack v2.9 does not require Top Item. Main, Overview, and ViewItem V2 still expect a future Yes/No SharePoint column displayed as Top Item, internal name Top_x0020_Item, default No. Add that column before repasting those screens.

Issues & Feedback

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